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 steps involved in establishing a connection using jdbc in java?
Name the types of jdbc drivers.
How can you make a connection?
Why do I have to reaccess the database for Array, Blob, and Clob data?
Can I enable requests to a jdbc connection pool for a database connection to wait until a connection is available?
What is an escape syntax?
What is the difference between ojdbc6 and ojdbc7?
How does a file store compare with a jdbc store?
What is a jdbc connection?
What is java soft framework?
What is the jdbc rowset?
What is jdbc and jdbc drivers?
How to check jdbc connection in java?
What is the purpose of the jdbc resultset interface?
What is JDBC DataSource and what are it’s benefits?