Hello,
I have a Java agent that makes use of SQL drivers for JDBC connection with SQL 2005 database for Domino 6.5. However, when I use the same agent for Domino 8.5 server, I get the following error message:
java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
at java.lang.Class.forName(Class.java:136)
at NotificationObserver.getConnection(NotificationObserver.java:162)
at NotificationObserver.createMessage(NotificationObserver.java:266)
at NotificationObserver.NotesMain(NotificationObserver.java:126)
at lotus.domino.AgentBase.runNotes(Unknown Source)
at lotus.domino.NotesThread.run(Unknown Source)
Has anyone faced this problem for Domino 8.5? Do I need to get new drivers compatible with Java 6? Or is there any classpath setting somewhere that might fix this issue?
Any help is highly appreciated.
Thanks in advance,
Rohan
Subject: Could be classpath
It does sound like a classpath issue. The error implies it cannot find the driver you are trying to load. Not sure how to set the JVM classpath for Domino.
Also, I found that the MS supplied JDBC driver to be not that great and the license resticts altering the distribution (ie. can’t copy just the files you need to the JVM). Look into the open-source jtds driver and copying the driver files into the JVM folder in your Domino installation.
Subject: Same error with Oracle
Hello,
Has anyone successfully written an agent in Java that uses JDBC to access a database?
I’m having the hardest time trying to put the pieces together.
I can run local java programs (samples) locally and they work. Then I try the JDBC ones and they don’t work.
Somehow, I need to setup my computer to be aware of jdbc classes.
Does anyone know how to start off or a good article that walks you through this process?
Subject: I figured it out
I had two problems.
First it was the CLASSPATH. I installed the java run time env 6 update 14. I then copied the oracle jar file to the lib directory of the java run time. Then I added the jar file to the classpath env variable.
Second problem was the connection string. I had the url port number of the database application server, so I double checked the TNS and used that for the connection string.
I also put an extra copy of the oracle jar file in notes\jvm\lib\ext also. Not sure at this point if that helped. I’m going to test it out again by deleting it in the jvm\lib.
Its past 5pm so I’m getting out of work, I will post the code tomorrow.
Subject: Thanks… I will try this.
Hi Steve,
It’s been a while since I gave up on the connection issue since a few other priorities have come up. Anyway, I will be getting back to it soon… I hope your post here would help me solve the problem.
Please post the code at your convenience.
Thanks,
Rohan
Subject: More Questions about your solution
Steve,
Where did you make these changes? Did you add it to the Classpath varible of the server?
I have copied the files under the jvm/ext folder. SQL server driver files seem to work fine but the agent fails to locate other jar files needed at the compile time. All these files are under the same ext folder. Can you please tell me where and what changes you made to the classpath?
Thanks,
Rohan
Subject: changed jobs
Everyone,
I switched jobs so didn’t get to finish it, and no it wasn’t to run away from this issue… hahaha 