Subject | something wrong with JDBC |
---|---|
Author | Algirdas Gurskis |
Post date | 2003-11-10T23:15:03Z |
Hello, somebody please explain me what I did wrong?
I’m downloaded “FirebirdSQL-1.0.1.zip” and put files:
mini-concurrent.jar
jaas.jar
mini-j2ee.jar
log4j-core.jar
firebirdjmx.jar
firebirdsql.jar
in my Java lib folder C:\j2sdk1.4.1_05\lib\
Compiling good, but when I’m try to execute, system show error message “Unable to load driver”
import java.sql.*;
public class TestConnect
{
public static void main(String[] Args){
String databaseURL="jdbc:firebirdsql://localhost:3050/c:/www/concordspa.gdb";
String user = "sysdba";
String password = "masterkey";
String driverName = "org.firebirdsql.jdbc.FBDriver";
Connection c = null;
try { Class.forName ("driverName"); }
catch (Exception E)
{ System.err.println("Unable to load driver.");
E.printStackTrace(); }
try {
c = DriverManager.getConnection(databaseURL, user, password);
System.out.println ("Connection established.");
c.close();
}
catch (SQLException E)
{
System.out.println ("Unable to establish a connection through the driver manager.");
E.printStackTrace();
}
}
}