Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

<identifier> expected Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");

843854Oct 16 2004 — edited Oct 18 2004
hi
Really i don�t now which is the mistake in this program.
plis some one tell if the driver is bad, o java is bad instaling or yhe program is bad write.
the error message is:

<identifier> expected
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
^
1 error

Process completed.

and the program is:

public class Prueba {
String url = "jdbc:mySubprotocol:myDataSource";
Connection con = null;
Statement stmt;


Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:datos";
Connection con = DriverManager.getConnection(url, "", "");


public static void main(String[] args) {
// Create application frame.
PruebaFrame frame = new PruebaFrame();

// Show frame
frame.setVisible(true);
}
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 15 2004
Added on Oct 16 2004
3 comments
391 views