jdbc sql server connection problem
I have this code in one of my services. The same connection
string and supporting lines are also in a java program that
works from the unix command line. In my log I see made it here
1 and made it here 2.2 but not made it here 3. Nothing is
getting caught in the catch. If I change the database name or
any of the other values a sql exception is thrown telling me
that the value I changed is incorrect. I put in a piece of code
to display the classpath and the sqljdbc.jar is in the path.
Why is this not working in caps like it is on the command line?
log_it( "MADE IT HERE 1" );
// Class.forName(
"com.SeeBeyond.jdbcx.sqlserver.SQLServerDataSource" );
Class.forName(
"com.microsoft.sqlserver.jdbc.SQLServerDriver" );
log_it( "MADE IT HERE 2.2" );
// log_it( "class path=" +
System.getProperty( "java.class.path" ) );
Connection con = DriverManager.getConnection(
"jdbc:sqlserver://chs_apps_3:1433;databaseName=EgateMonitor1;use
r=egate;password=egate" );
// Connection con =
DriverManager.getConnection(
"jdbc:sqlserver://chs_apps_31:1433", "egate", "egate" );
log_it( "MADE IT HERE 3" );
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery( "SELECT
COUNT(*) AS Expr1 FROM caps_threshold WHERE (component_name='" +
collabName + "')" );
rs.next();
int query_count = rs.getInt( "Expr1" );

