Kbase P121152: SQL-92: Error "Connection reset" running java code that executes a SQL-92 query
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  1/2/2009 |
|
Status: Verified
SYMPTOM(s):
SQL-92: Error "Connection reset" running java code that executes a SQL-92 query
SQL-92: Error "A server crash is likely" running java code that executes a SQL-92 query
java.sql.SQLException:[DataDirect][OpenEdge JDBC Driver][DataDirect][OpenEdge JDBC Driver]Connection reset
java.sql.SQLException: [DataDirect][OpenEdge JDBC Driver][DataDirect][OpenEdge JDBC Driver]A server crash is likely.
The error "Connection reset" occurs when the java code is executed on a Windows platform.
The error "A server crash is likely." occurs when the same java code is executed on a Linux platform.
The SQL-92 query being executed by the java code is similar to the following:
SELECT
FieldOne,
FieldTwo
FROM
PUB.TableName
WHERE
FieldThree = ? AND
FieldFour = ? AND
FieldFive = ?;
The JAVA client code invokes the setInt() method of the public interface PreparedStatement using the following statement:
ps.setInt(2, 36533);
FACT(s) (Environment):
All Supported Operating Systems
OpenEdge 10.1x
CAUSE:
The second argument of the setInt() method is given as INTEGER in the java code while the the designated parameter FieldFour has CHARACTER data type in the database table.
FIX:
Invoke the setSTring() method of the PreparedStatement Interface as per the following example:
ps.setString(2, "36533");