0

Our Java servlet connects to a SQL server 2005 database using the sqljdbc.jar driver in Tomcat\lib directory (Windows) and encrypts using SSL with the signed certificate in a keystore. This works fine, but the database has now been migrated to SQL Server 2008 R2 and the connection stopped working. I have successfully created a connection with the credentials using SQL Server Management Studio so the credentials and port number are fine etc. I found using the JTDS driver (version 1.2.7) allowed a successful connection but I cannot get the encryption to work using SSL. I added the JNDI attribute of "ssl=require" to the URL in the Tomcat JNDI but this still does not work. I also tried "ssl=authenticate" but again no encryption.

What am I doing wrong? Here is the JNDI entry although with certain information such as password and server nbame hidden.

<Resource auth="Container" driverClassName="net.sourceforge.jtds.jdbc.Driver"   
factory="org.moss.jdj.dbcp.EncryptedDataSourceFactory" maxActive="100" maxIdle="30" 
maxWait="10000" name="jdbc/edrms" password="*******" type="javax.sql.DataSource" 
url="jdbc:jtds:sqlserver://********:2369:\ngedm;databaseName=*******;ssl=require"  
username="*******" />
vzamanillo
  • 9,905
  • 1
  • 36
  • 56
AJF
  • 1,801
  • 4
  • 27
  • 54
  • @vzamanillo thanks for correcting my question. Do you have any guidance on resolving the problem? – AJF Dec 03 '14 at 09:44
  • What is your JVM runtime? – vzamanillo Dec 03 '14 at 10:31
  • @vzamanillo my current JVM (jre and jdk) are 1.6.0.29 but since i posted my last comment I have found the following URL and I am currently upgrading to 1.6.0.30 and go back to using Microsofts JDBC4 to see if this resolves the issue. See I tried Microsofts JDBC4 and it just keot timing out and hence I found JTDS worked but then I have the SSL problem. http://stackoverflow.com/questions/7841411/driver-getconnection-hangs-using-sqlserver-driver-and-java-1-6-0-29 – AJF Dec 03 '14 at 10:49
  • Did you try upgrading to the latest JTDS driver? Did you applied the Sql Server 2008 SP2 to your database server? – vzamanillo Dec 03 '14 at 10:56
  • @vzamanillo Thanks for more feedback. Yes I tried latest version of JTDS (version 1.3.1) but it wouldn't work with Java 1.6.0.29. I aim to upgrade to Java 7 soon but a former colleague told me that there was a fundamental change to java in version 7 and I will have to investigate before upgrading toi version 7 of Java – AJF Dec 03 '14 at 11:27
  • @vzamanillo as for SQL Server 2008 upgrading I found the link below but unfortunately I have to get our infrastructure to do that one as we are not allowed. But it is in hand http://support.microsoft.com/kb/2653857 – AJF Dec 03 '14 at 11:29
  • @AJF Could you please provide the part of EncryptedDataSourceFactory that creates the datasource? – jkonst Sep 15 '15 at 15:07

0 Answers0