JDBC Type 4 Driver

I wrote an agent to use jdbc type 4 drivers to connect to db2. When I run the agent on my local PC, it works fine. But, when I run it on the server, I get the below error:[ibm][db2][jcc] Missing resource bundle: a resource bundle could not be found in the com.ibm.db2.jcc package for IBM DB2 JDBC Universal Driver Architecture

I know it must be some files I need to add to the server, but do not know what and where to add it to. Your help is very much appreciated.

Below is a snippet of my codes:

public java.sql.Connection getJDBConnection(String jdbcURL, String jdbcUser, String jdbcPassword) throws Exception {

	java.sql.Connection con = null;

		try {

			Class.forName("com.ibm.db2.jcc.DB2Driver");





			con =

				DriverManager.getConnection(

					jdbcURL,

					jdbcUser,

					jdbcPassword);

			return con;

		} catch (Exception e) {

			System.err.println("problems connecting to " + jdbcURL + ":");

			System.err.println(e.getMessage());

			if (con != null) {

				try {

					con.close();

				} catch (Exception e2) {

					e2.printStackTrace();

				}

			}

			return null;

		} // end catch

	}

Subject: JDBC Type 4 Driver

load all the .jar files onto the server. then add a JavaUserClasses notes.ini variable (on server) that points to the jars.

JavaUserClasses=C:\jars\ibmjdbc.jar;C:\jar\blah.jar

also… sometimes domino doesn’t load this var if it is the last entry… so move it up a few positions in the file.

Subject: RE: JDBC Type 4 Driver

Mark,Thanks for your response. What jar files do I need to load? Does it matter what directory?

Thanks again.

Subject: RE: JDBC Type 4 Driver

Mark,I added db2jcc.jar and db2jcc_license_cu.jar to the server, add the paths to the notes.ini. (db2java.zip file is already on the server and note.ini). Restarted the server. Now, I get a different error:

07/13/2005 06:20:46 PM AMgr: Agent (‘JDBCDemo’ in ‘DEV\JDBCDemo.nsf’) error message: problems connecting to jdbc:db2://mw60z.md.companyname.com:60012/yidtest:

07/13/2005 06:20:46 PM AMgr: Agent (‘JDBCDemo’ in ‘DEV\JDBCDemo.nsf’) error message: mw60z.md.companyname.com,-1

07/13/2005 06:20:46 PM AMgr: Agent (‘JDBCDemo’ in ‘DEV\JDBCDemo.nsf’) error message: java.lang.NullPointerException

07/13/2005 06:20:46 PM AMgr: Agent (‘JDBCDemo’ in ‘DEV\JDBCDemo.nsf’) error message: at JavaAgent.NotesMain(JavaAgent.java:23)

07/13/2005 06:20:46 PM AMgr: Agent (‘JDBCDemo’ in ‘DEV\JDBCDemo.nsf’) error message: at lotus.domino.AgentBase.runNotes(Unknown Source)

07/13/2005 06:20:46 PM AMgr: Agent (‘JDBCDemo’ in ‘DEV\JDBCDemo.nsf’) error message: at lotus.domino.NotesThread.run(NotesThread.java:215)

07/13/2005 06:20:46 PM AMgr: Agent (‘JDBCDemo’ in ‘DEV\JDBCDemo.nsf’) error message: Error closing jdbc connection

This is so frustrating, I’m so close and yet so far…any help or suggestion is appreciated.

Subject: RE: JDBC Type 4 Driver

Sara,Look like you need to change the jdbc url connection string to point to your db2 server. Talk to your db2 dba and get its host name and username/password and port required to access the db. Then change those params in whatever java agent you are running.

Mark