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 jdbc and odbc?
How can I get or redirect the log used by DriverManager and JDBC drivers?
What is ODBC and JDBC? How do you connect the Database?
What is jdbc connection?
What is ojdbc14 jar?
Why resultset is used in java?
What is the JDBC syntax for using a literal or variable in a standard Statement?
Can we return resultset in java?
Does sql allow null values ? Can we use it within where clause ?
What is jdbc? Describe the steps needed to execute a sql query using jdbc.
Does jdbc use ssl?
What is database deadlock ? How can we avoid them?
How we can you use preparedstatement.
Briefly tell about the jdbc architecture.
How do we load the drivers?