By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,865 Members | 1,717 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,865 IT Pros & Developers. It's quick & easy.

java DB2 program error

P: 2
am trying to run a java db2 program. my db2 is in os/390.
below is the code
public class T4DB2Connect {
public static void main(String[] args) {


try {
// load the DB2 Driver
System.out.println("1" );
Class.forName("COM.ibm.db2os390.sqlj.jdbc.DB2SQLJD river");
// establish a connection to DB2
System.out.println("2" );
Connection db2Conn = DriverManager.getConnection("jdbc b2://host ip address/db name","user id","passwd");
System.out.println("3" );
Statement st = db2Conn.createStatement();
System.out.println("4" );
String query =
"SELECT A.BJB_SCSJB_NM FROM CRYWTBT.TBSUC_JOBS A ,CRYWTBT.TBPRD_JOBS B, CRYWTBT.TBJOB_FREQ C WHERE A.BJB_NM ='CLR606AM' AND A.BJB_NM=B.BJB_NM AND B.BJB_NM=C.BJB_NM";
ResultSet resultSet = st.executeQuery(query);
System.out.println("Job " + "\tAverage Salary");
System.out.println("-----" + "\t--------------");
while (resultSet.next()) {
String jobType = resultSet.getString(1);
System.out.println(jobType );
}
resultSet.close();
st.close();
db2Conn.close();
} catch (ClassNotFoundException cnfe) {
cnfe.printStackTrace();
} catch (SQLException sqle) {
sqle.printStackTrace();
}
}
}

the error is
1
2
com.ibm.db2.jcc.b.DisconnectException: Execution failed due to a distribution pr
otocol error that caused deallocation of the conversation. A DRDA Data Stream S
yntax Error was detected. Reason: 0x3
at com.ibm.db2.jcc.a.ab.l(ab.java:1214)
at com.ibm.db2.jcc.a.ab.c(ab.java:363)
at com.ibm.db2.jcc.a.ab.v(ab.java:1447)
at com.ibm.db2.jcc.a.bb.a(bb.java:39)
at com.ibm.db2.jcc.a.b.e(b.java:1232)
at com.ibm.db2.jcc.a.b.b(b.java:1147)
at com.ibm.db2.jcc.a.b.q(b.java:931)
at com.ibm.db2.jcc.a.b.a(b.java:702)
at com.ibm.db2.jcc.a.b.(b.java:305)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:1 62)
at java.sql.DriverManager.getConnection(DriverManager .java:512)
at java.sql.DriverManager.getConnection(DriverManager .java:171)
at T4DB2Connect.main(T4DB2Connect.java:16)


when i tried to change the jdbc connection to
Connection db2Conn = DriverManager.getConnection("jdbc b2os390://host ip address/db name","user id","passwd");
the error

com.ibm.db2.jcc.b.SqlException: Deprecated DB2 OS/390 protocol not supported by
T4: jdbc b2os390://host ip address/db name
Use protocol jdbc b2:
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:9 8)
at java.sql.DriverManager.getConnection(DriverManager .java:512)
at java.sql.DriverManager.getConnection(DriverManager .java:171)
at T4DB2Connect.main(T4DB2Connect.java:16)
Mar 10 '06 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.