Lotus Notes & SQL: Problems with how we do it...

Hello,

We have problems connecting to a SQL 2000 database via Lotus Notes 7.0 (an agent).

Apart from a solution for the error, for which I will give details below,if anyone has created a succesful link we would be happy to know how. Including which jars are used, and how they are installed in Lotus Notes. We think we do it right, but since it does not work, we might not do it right. (We use the javaclasspath in notes.ini; jars local on machine)

As forthe error, I included the most important parts here, if more information is needed I be happy to give it. Apart from a solution, a direction to search for it can also be helpful. Google did not really help us here.

Error occurs in 2nd line:

Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");

con = DriverManager.getConnection(url);

where url isjdbc:sqlserver://..:1433;databaseName=..;user=..;password=..;

This is the error:

java.lang.NoClassDefFoundError: java/nio/charset/Charset

at com.microsoft.sqlserver.jdbc.SQLCollation.readCollation(Unknown Source)

at com.microsoft.sqlserver.jdbc.SQLCollation.<init>(Unknown Source)

at com.microsoft.sqlserver.jdbc.IOBuffer.processEnvChange(Unknown Source)

at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)

at com.microsoft.sqlserver.jdbc.SQLServerConnection.processLogon(Unknown Source)

at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(Unknown Source)

at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)

at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)

at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)

at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)

at java.sql.DriverManager.getConnection(DriverManager.java:539)

at java.sql.DriverManager.getConnection(DriverManager.java:211)

at nl.amnesty.crm.mail.JDBCSQLServerConnection.openConnection(JDBCSQLServerConnection.java:172)

at nl.amnesty.crm.mail.JavaAgent.NotesMain(JavaAgent.java:17)

at lotus.domino.AgentBase.runNotes(Unknown Source)

at lotus.domino.NotesThread.run(Unknown Source)

Thanks!

Bert

[2357 byte] By [Bikea] at [2007-11-26 17:53:49]
# 1
Looks like you're running too old a JVM for the JDBC driver.Charset was introduced in 1.4 so if you've got an older JVM than that it looks like you're out of luck.
dcmintera at 2007-7-9 5:06:51 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

Yes, something like that. With help from a collegue I learned the Lotus Notes java environment is different from the normal java environment. It also appeared my Lotus Notes setup was not correct.

After reinstalling Lotus Notes (now 7.0.2) and then copy the extra jar into ..\jvm\lib\ext (and restart Notes) it worked!

I do not think I had an older java in the first place, but that the problem was my notes-setup. Well, never mind the cause, I like the solution.

Bikea at 2007-7-9 5:06:51 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3

hello,

I'm also setting up SQL JDBC to connect to SQL 2000 via JAVA agent and not sure how to set things up in Domino...

did you have to install the Java Run Time (JVM) environment 1.4 on the server, how was the class path set up?

If possible could you forward a code snippet of the Domino agent connection piece? Any help woud be very much appreciated.

Regards,

DouglasB

dougsba at 2007-7-9 5:06:51 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...