Something wrong with my JavaAgent. boring~

i wrote a JavaAgent with Designer for retrieving data from domino database and putting them into DB2.

DECS is started, and i setup a connection to DB2.

In my code, i import the lotus.domino.* package and java.sql.* package. And then, wrote a pieces of code for connection.

the code below:

…

try {

Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");

conn = DriverManager.getConnection(url, user, pass);

} catch (Exception ex) {

...

}

…

but, there is a error “java.lang.NoClassDefFoundError” when i run my JavaAgent.

Plz help me with it, it’s so boring and i tried so many times, it almost drives me crazy.

Subject: Something wrong with my JavaAgent. boring~

hi

not sure at all, but this is a little bit strange.

Class.forName(“COM.ibm.db2.jdbc.app.DB2Driver”);

you never affect the return value of forName …

and I believe that ‘COM’ should be ‘com’, in lower case.

… and make sure that com.ibm… is in your classpath when executing.

HTH

Subject: RE: Something wrong with my JavaAgent. boring~

Thank u for ur help!

But I dont know clearly about how to make sure that driver has already been included my classpath.

btw, how to set my classpath? i just write the db2java.zip, notes.jar and ncso.jar three files’ path to classpath environment variable of OS.

The package that included “COM.ibm…” is correct. They are all in the db2java.zip file in SQLLIB\Java directory. And you mentioned that “com.ibm.db2…” package is in the db2jcc.jar file in the same directory with db2java.zip file.

i confused that why it can not run correctly although i has already included all of files i need.

Subject: RE: Something wrong with my JavaAgent. boring~

Copy your jar files to Domino/data/domino/java directory as this is the default directory for all the jar files and also which domino recognises.

Domino will not understand .zip files. What is present in the .zip file.

–Phani

Subject: RE: Something wrong with my JavaAgent. boring~

Thank u all! the question solved! appreciate!