I'm having problems with a mysql database - jsp interaction.
HERE'S MY CODE:
System.setProperty("jdbc.drivers","org.gjt.mm.mysql.Driver"
;
System.out.println("JDBC driver loaded"
;
String url = "jdbc:mysql://localhost/wls/devportal/ca/jsp/test?user=root&password=temp";
con = DriverManager.getConnection(url);
System.out.println("Database connection established"
;
HERE'S THE OUTPUT:
JDBC driver loaded
SQLException: Could not connect to database
----------------------
So apparently it is loading the driver, but just can't load the database. Do I have to put the database program (mysql) in a particular folder on my local machine? Is the path specified //localhost/wls/devportal/ca/test the folder which contains the database files? Currently, my database is in my program files folder in windows...
When I load my application using tomcat, the url is:
On my hard drive, this corresponds to:
c:\users\
The mysql database is called test, and the folder containing those files is located on my hard drive:
c:\program files\mysql\data\test
The mysql server is on my hard drive too:
c:\program files\mysql\bin
The mysql driver loads okay, but it can't find the database. Please help!
Thanks,
John
ANY AT ALL HELP IS APPRECIATED!!!
HERE'S MY CODE:
System.setProperty("jdbc.drivers","org.gjt.mm.mysql.Driver"
System.out.println("JDBC driver loaded"
String url = "jdbc:mysql://localhost/wls/devportal/ca/jsp/test?user=root&password=temp";
con = DriverManager.getConnection(url);
System.out.println("Database connection established"
HERE'S THE OUTPUT:
JDBC driver loaded
SQLException: Could not connect to database
----------------------
So apparently it is loading the driver, but just can't load the database. Do I have to put the database program (mysql) in a particular folder on my local machine? Is the path specified //localhost/wls/devportal/ca/test the folder which contains the database files? Currently, my database is in my program files folder in windows...
When I load my application using tomcat, the url is:
On my hard drive, this corresponds to:
c:\users\
The mysql database is called test, and the folder containing those files is located on my hard drive:
c:\program files\mysql\data\test
The mysql server is on my hard drive too:
c:\program files\mysql\bin
The mysql driver loads okay, but it can't find the database. Please help!
Thanks,
John
ANY AT ALL HELP IS APPRECIATED!!!