Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error connecting to DB2 database in localhost

 
Drake Almonto
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am attempting to connect to a DB2 database from a servlet on my localhost. I am running with ServletExec ISAPI in IIS. I am receiving a NullPointerException from the DriverManager. The stack trace is included below. I have verified that I am sending the correct URL, user and password. I am able to connect to the database and query the tables from the command window on my machine. However, my servlet has trouble on the getConnection method in the DriverManager. The command is

con = DriverManager.getConnection(URL, user, password);

Can anyone help?

Thanks!


java.lang.NullPointerException
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(Unknown Source)
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2Connection.connect(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2Connection.(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2Driver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at ConnectionManager$DBConnectionPool.newConnection(ConnectionManager.java:396)
at ConnectionManager$DBConnectionPool.getConnection(ConnectionManager.java:330)
at ConnectionManager.getConnection(ConnectionManager.java:83)
at custMgr.singleCust.Logon.doGet(Logon.java:39)
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic