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
Is jdbc faster than hibernate?
How can I use the JDBC API to access a desktop database like Microsoft Access over the network?
What is the function of setautocommit?
How many jdbc driver types are there?
How can we store the file in the oracle database?
What is the meaning of “dirty read” in the database?
What are the main components of JDBC ?
How to update a resultset programmatically?
What is JDBC Connection? Explain steps to get Database connection in a simple java program.
What is ojvm used for?
What are the different types of interfaces in the api component?
Explain about multiple implementations and drive manager?
What is difference between statement and preparedstatement in jdbc?
What is jdbc and jdbc drivers?
What are the different types of statements? How we can you use preparedstatement.