This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JDBC and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark ""no suitable driver" problem while connecting to Access" Watch ""no suitable driver" problem while connecting to Access" New topic
Author

"no suitable driver" problem while connecting to Access

yali
Greenhorn

Joined: May 03, 2002
Posts: 2
whenever i try to connect to the access database from the applet, i get the sql exception - "no suitable driver".
given below is the code snippet from my program which i use to connect to the database :

try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

}
catch(ClassNotFoundException e)
{
System.err.print("\n ClassNotFoundException: ");
System.err.println(e.getMessage());
}

try
{
con = DriverManager.getConnection("jdbc dbc:candidate","","");
System.out.println("\n Connected to Database...");
}
catch(Exception e)
{
System.err.println("\n ERROR : " + e);
}

please help me as this problem has been bugging me from a long time and making me frustrated
thanx for any help in advance :p
[ May 03, 2002: Message edited by: yali ]
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Which version of JDK r u using?
Originally posted by yali:
whenever i try to connect to the access database from the applet, i get the sql exception - "no suitable driver".
given below is the code snippet from my program which i use to connect to the database :

try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

}
catch(ClassNotFoundException e)
{
System.err.print("\n ClassNotFoundException: ");
System.err.println(e.getMessage());
}

try
{
con = DriverManager.getConnection("jdbc dbc:candidate","","");
System.out.println("\n Connected to Database...");
}
catch(Exception e)
{
System.err.println("\n ERROR : " + e);
}

please help me as this problem has been bugging me from a long time and making me frustrated
thanx for any help in advance
[ May 03, 2002: Message edited by: yali ]


Groovy
yali
Greenhorn

Joined: May 03, 2002
Posts: 2
i'm using JDK 1.3
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"yali",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp .
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please re-register and select a new name which meets the requirements.
Thanks.
Dave
 
 
subject: "no suitable driver" problem while connecting to Access