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
What is a statement in java?
What do you mean by jdbc batch processing and what are the advantages of using jdbc batch processing?
How does a file store compare with a jdbc store?
What is SQL Warning? How to retrieve SQL warnings in the JDBC program?
Does jdbc require oracle client?
Which interface handles transaction management in jdbc?
Does jdbc use odbc?
How to move the cursor in scrollable resultset ?
What causes the "No suitable driver" error?
Does jpa use jdbc?
What is the role of class.forname while loading drivers?
How can we set null value in jdbc preparedstatement?
What is jdbc odbc driver?
What is the use of jdbc api?
Explain how data flows from view to db and reverse