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 |
What is the use of jdbc api?
What are the types of statements in jdbc?
Explain the sequence of steps to connect to the database?
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 are the factors that the jdbc driver performance depends upon?
How can you know about drivers and database information ?
Is jdbc a framework?
Which is best database for java?
What is the difference between client and server database cursors?
what is meant by connection pooling?
i have 1000 records in resultset, how to get first 100 records from resultset, because resultset fetch all 1000 records at a time?
Write an sql to find all records having all upper case alphanumeric characters in a field ?