MY code is: public class P1{
public static void main(String ar[])
{
class.forName("java.lang.String");
}
}
errors i got are :New.java:5: error: <identifier> expected
class.forName("java.lang.String");
^
New.java:5: error: invalid method declaration; return type
required
class.forName("java.lang.String");
^
New.java:5: error: illegal start of type
class.forName("java.lang.String");
^
New.java:7: error: reached end of file while parsing
}
^
4 errors
HELP ME>......
Answer Posted / khasim
I think first error is...
1.Here in class name is Class.So we have to write Class.forName...(C caps)
2.forName() is used to register Driver.we have to specify any one of four drivers
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the different types of drivers under jdbc?
How can you load the drivers?
What are the steps to connect to the database in java?
What is the benefit of having jdbcrowset implementation? Why do we need a jdbcrowset like wrapper around resultset?
What are the different types of locking in JDBC?
How do I start debugging problems related to the JDBC API?
How to test jdbc connection to sql server?
Why hibernate is better than jdbc?
How many types of jdbc drivers are there?
How many categories of jdbc drivers are there?
What do you mean by batch processing in jdbc?
Is jdbc faster than hibernate?
What is the difference between ojdbc6 and ojdbc7?
In which ways is driver class is registered with drive manager?
What is the return type of class.forname() method?