Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with connection to mySQL with JDBC

4 views
Skip to first unread message

Juha Vehnia

unread,
Apr 9, 1998, 3:00:00 AM4/9/98
to

I get the following error when trying to connect mySQL database (as well
as it is the only output I get)

No suitable driver
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:111)
at java.sql.DriverManager.getConnection(DriverManager.java:134)
at testSelect.main(testSelect.java:35)

Everything seems to be okey. Source code is also included here.
Exception occurs before the program gets to line
System.out.println("Driver loaded...."); I also created required user
for mySQL database, as well as database it self and access permission
for non-local users. Database is listening right port 3306 (in my case,
default port).

-----------------------------
import java.net.URL;
import java.sql.*;
import gwe.sql.*;

class testSelect {
public static void main(String argv[]) {
try {

// Load the gweMysqlDriver JDBC Driver

Class.forName("gwe.sql.gweMysqlDriver");

// The url of the database we wish to connect to
// jdbc:mysql://host:port/database

String url = "jdbc:mysql://mysecret.url:3306/test";

// Set up a connection, as user and password (both as
// clear text here - the password is encrypted by the
// driver
// An empty username is changed to "nobody" in mysql

Connection con = DriverManager.getConnection(url, "mylogin",
"mypassword");

// Print out something, if ever get here
System.out.println("Driver loaded....");

----
--

-------------------

I appreciate if anybody have any successtions or answers how to get this
thing working.

Thanks,

Juha Vehnia,
CREC, University of Texas

Jo Uthus

unread,
Apr 14, 1998, 3:00:00 AM4/14/98
to

Juha Vehnia <juh...@evitech.fi> writes:

| I get the following error when trying to connect mySQL database (as well
| as it is the only output I get)
|
| No suitable driver
| java.sql.SQLException: No suitable driver
| at java.sql.DriverManager.getConnection(DriverManager.java:111)
| at java.sql.DriverManager.getConnection(DriverManager.java:134)
| at testSelect.main(testSelect.java:35)
|
| Everything seems to be okey. Source code is also included here.
| Exception occurs before the program gets to line
| System.out.println("Driver loaded...."); I also created required user
| for mySQL database, as well as database it self and access permission
| for non-local users. Database is listening right port 3306 (in my case,
| default port).

Have you added the path to your gwe-drivers in your CLASSPATH ?


--
Jo
Slave Gnusae

0 new messages