I have installed:
1. VisualCafe V4.1a
2. Mysql
3. Mysql driver, mm.mysql-2.0.4-src.jar (extracted).
4. JRun Application Manager (up and running)
I have written the following test code:
import java.sql.*;
public class DBTest {
// localhost = 127.0.0.1
static String dbUrl = "jdbc:mysql//127.0.0.1:3306/menagerie";
Connection conn = null;
private void start() {
try {
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
System.out.println("A0:");
conn = DriverManager.getConnection(dbUrl);
System.out.println("A1:");
} catch (InstantiationException e) {
System.out.println("Error: InstantiationException");
} catch (ClassNotFoundException e) {
System.out.println("Error: ClassNotFoundException");
} catch (IllegalAccessException e) {
System.out.println("Error: ClassNotFoundException");
} catch (SQLException E) {
System.out.println("Error: SQLException");
}
}
public static void main(String [] args) {
DBTest t = new DBTest();
t.start();
}
}
When I run this I get the following result (error):
A0:
Error: SQLException
Indicating, that the DriverManager can't get do a connection !
What do I have to do, to be able to connect to the database ?
Do I need an Internet Server (Apache or is it enough with JRun ?) ? Do
I have to setup the JRun (and how do I do that) ? Is my dburl wrong (I
want to just run local on my machine) ?
Thanks in advance!
Mats
Well, it would help if you actually showed what the exception told
you... exceptions generally contain messages which tell you what went
wrong. Without seeing what's in the exception, it could be almost
anything.
--
Jon Skeet - <sk...@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:535)
at java.sql.DriverManager.getConnection(DriverManager.java:174)
at Test.main(Test.java:17)
Ian.
"Mats Bjornlund" <mats.bj...@capgemini.se> wrote in message
news:7aec40b2.01101...@posting.google.com...