JDBC error during connection to MSSQL
Hi,
I'm trying to connect to MSSQL database but i get several errors during this. I have MSSQL driver installed in osgi and JDBC connection pool set with these values
JDBC Driver class = com.microsoft.sqlserver.jdbc.SQLServerDriver JDBC connection URI = jdbc:sqlserver://myserver;databaseName=mydb Datasource name = mssqlTest
and my code looks like this
try{ DataSourcePool dspService = sling.getService(DataSourcePool.class); PreparedStatement preparedStatement = null; Connection connection = null; DataSource ds = (DataSource) dspService.getDataSource("mssqlTest"); if(ds != null){ log.info("getting connection"); connection = ds.getConnection(); // here the script fails, this is line 32 log.info("got connection!"); preparedStatement = connection.prepareStatement(SQL); /* execute the SQL statement */ log.info("gonna execute query"); ResultSet rs = preparedStatement.executeQuery(); log.info("query executed!"); if(rs.first()){ log.info("Some data here!"); } }else{ log.error("DataSource = null!!!!"); } }catch(SQLException e){ log.error("SQLException :"+e.getMessage()); }catch(Exception e){ log.error("Undefined exception: "+e.getMessage()); }The exceptions I get are
25.09.2013 10:12:15.392 *ERROR* [10.224.133.98 [1380096735273] GET /content/TEST/302104/mssql.html HTTP/1.1] com.day.cq.wcm.core.impl.WCMDebugFilter Exception: An exception occurred processing JSP page /apps/TEST/components/mssql_test/mssql_test.jsp at line 32 org.apache.sling.api.scripting.ScriptEvaluationException: An exception occurred processing JSP page /apps/TEST/components/mssql_test/mssql_test.jsp at line 32 Caused by: org.apache.sling.api.SlingException: An exception occurred processing JSP page /apps/TEST/components/mssql_test/mssql_test.jsp at line 32 Caused by: java.lang.NoClassDefFoundError: javax/net/ssl/SSLSocket Caused by: java.lang.ClassNotFoundException: javax.net.ssl.SSLSocket not found by com.microsoft.sqlserver.jdbc [341]
The entire exception is here
http://pastebin.com/tbheRKjt
Thanks for any help