I am attempting to use custom java app that queries a mssql server on another machine for data and returns it to CRS.
When I test the code from my dev machine or the command line on the crs server it returns data without issue but when I upload the jar file into CRS and attempt to call the same method in the script editor it fails and gives me the default prompt. I suspect that it is failing on the Class.getName.
I have tried to include the jar file with the jdbc driver in the jar file and reference it as a class path value in the manifest and I have also tried to upload it directly to CRS; neither of which worked.
I am really not sure how to troubleshoot this any further since I can not expose the exceptions when the code is called via the CRS script.
Is anyone out there using JDBC from a library that is uploaded into CRS?
Please help! Thank you in advance!
Two things to check:
1- You need to be sure that your custom class is compiled with the correct JRE version. Ex: for IPCC 4.0, you should use jre1.4.2_05.
2- Here is an example on how I'm using the JDBC driver:
Connection lCon = null;
String lQuery = "SELECT [Key],[Value] FROM " + mTableName;
mURL = "jdbc:odbc:" + pDataSource + ";UID=" + pUsername + ";PWD=" + pPwd;
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
lCon = DriverManager.getConnection(mURL);
lStmt = lCon.createStatement();
lResultSet = lStmt.executeQuery(lQuery);
I hope this help !