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>......
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / 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 |
Answer / salman
public class P1
{
public static void main(String args[])
{
try
{
Class.forName("java.lang.String");
}catch(Exception ex){}
}
}
Is This Answer Correct ? | 1 Yes | 2 No |
How many types of jdbc drivers are available?
How many categories of jdbc drivers are there?
Can we use the one instance of Statment to execute more than one query ?
What is connection pooling? What Method and class used for Connection pooling in Java?
What is JDBC Driver interface?
RowSetInternal caller and returns void. What can I do in the readData method?
any one can explain about policy file rule? when i connect database with applet then ther is no compile time error but the run time error is occureed.i.e access is denied.policy file rule is related to this problem.
What does jdbc do?
What are devices?
How do I find ojdbc jar version?
What is JDBC DataSource and what are it’s benefits?
What is jdbc thin client?