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
If you are given a choice to implement the code to either insert a record or update if already exist, which approach will you follow ?
How to get the Database server details in java program?
Can I use JDBC to execute non-standard features that my DBMS provides?
Explain about the Try Block?
password, is stored in as plain text. What can I do to protect my passwords?
What are the new features added to JDBC 4.0?
What is the reason why we need a jdbcrowset like the wrapper around resultset?
How are jdbc statements used?
How to connect html page to database using jdbc?
What is the use of getGeneratedKeys() method in Statement?
Why resultset is used in java?
Explain the difference between rowset vs. Resultset in jdbc?
Under what circumstances, that all four drivers are used?
What are the basic exceptions in jdbc?
What is jdbc databasemetadata interface?