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 do you mean by batch processing in jdbc?
What is the advantage of namedparameterjdbctemplate?
When do we get java.sql.SQLException: No suitable driver found?
Is jdbc connection secure?
What are the steps to connect to a database in java?
What is the major difference between java.util.date and java.sql.date data type?
What is drivermanager in jdbc?
What are the 4 types of jdbc drivers?
Is jdbc and orm?
What is drivermanager in java?
What is jdbc connection interface?
How to achieve JDBC Connection Pooling using JDBC DataSource and JNDI in Apache Tomcat Server?
What does executeupdate return in jdbc?
What is jdbc architecture in java?
What are different types of JDBC Drivers?