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


Please Help Members By Posting Answers For Below Questions

What is in term of jdbc a datasource?

566


Explain the role of driver in jdbc.

650


What is metadata in jdbc?

563


What is a lock in jdbc?

626


Does sql allow null values ?

633






What is while rs next ())?

573


Can resultset be null in java?

585


How do I find whether a parameter exists in the request object?

575


What do you understand by jdbc datasource?

670


Explain in detail about JDBC and its general features?

605


Which database is used for java?

600


What are collection pools?

590


What is preparedstatement in jdbc?

595


How do I retrieve a whole row of data at once, instead of calling an individual ResultSet.getXXX method for each column?

683


What is jdbc and its types?

569