Trouble connecting to the database (IBM DB2 from a servlet)
Posted on 2004-04-17
I am currently doing a small web application which is a HTML form which allows the user to search and add to a database.
Everything seemed to be working fine until i reinstalled DB2.
Now when i run the program, it gets caught on the sql exception whilst trying to connect:
Here is the code:
public void init(ServletConfig config) throws ServletException
connection = DriverManager.getConnection(URL, "administrator", "password");
System.err.println("Failed to load JDBC/ODBC driver.");
jdbcDriverError = true;
System.err.println("Unable to connect! - " +
"Check the connection string"); <-----------THIS SHOWS IN THE LOG FILE
sqlError = true;
can anyone please help me