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
What is in term of jdbc a datasource?
Explain the role of driver in jdbc.
What is metadata in jdbc?
What is a lock in jdbc?
Does sql allow null values ?
What is while rs next ())?
Can resultset be null in java?
How do I find whether a parameter exists in the request object?
What do you understand by jdbc datasource?
Explain in detail about JDBC and its general features?
Which database is used for java?
What are collection pools?
What is preparedstatement in jdbc?
How do I retrieve a whole row of data at once, instead of calling an individual ResultSet.getXXX method for each column?
What is jdbc and its types?