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 / siva mukesh
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 ? | 7 Yes | 3 No |
Post New Answer View All Answers
Does the database server have to be running Java or have Java support in order for my remote JDBC client app to access the database?
Is jdbc part of j2ee?
What are the different types of JDBC drivers?
How does jdbc connect to database?
How do I find whether a parameter exists in the request object?
Write an sql to find all records having all upper case alphanumeric characters in a field ?
How can we set null value in jdbc preparedstatement?
Explain the main method?
What does setautocommit do?
Which jdbc drivers will run your program?
What is jdbc servlet?
How many rowset are available in jdbc?
What is jdbc and jdbc drivers?
What are clob and blob data types in jdbc?
What is jdbc dialect?