How do I achieve queryaccelearation=all and packageset using Java JDBC?

3783 views java
7

i am setting the queryaccelearation=all in below code and i am getting the below exception.

//set queryacceleration
String url = "host:60010/DB2:user=xxxx;password=yyyyy;specialRegisters=CURRENT QUERY ACCELERATION=ALL;";

                 con = DriverManager.getConnection(url,props); -? ERROR:  com.ibm.db2.jcc.am.SqlSyntaxErrorException: [jcc][10214][10050][3.62.56] java.util.Properties object passed to java.sql.Driver.connect() cannot be overridden by URL: jdbc:db2://ddcs.us.bank-dns.com:50010/DB2T:user=xxxxx;password=yyyyy;specialRegisters=CURRENT QUERY ACCELERATION=ALL;. ERRORCODE=-4461, SQLSTATE=42815

Thanks, Rasheed SK

answered question

1 Answer

10

I am trying to the db2 database packageset into java jdbc application i am getting the below error. please see the below code for me.

              //Declare the packageset
                                     String packageset=”F9DERWSl”;

              // Set user ID for the connection
                 props.put("user", props.getProperty("DB2_USERNAME"));
                 // Set password for the connection
                 props.put("password", props.getProperty("DB2_PASSWORD"));

                 // set securityMechanism
                 props.put("securityMechanism",
                              new String("" + com.ibm.db2.jcc.DB2BaseDataSource.ENCRYPTED_USER_AND_PASSWORD_SECURITY + ""));
                 props.put("encryptionAlgorithm", "2");

                 // getting the database connection
                 con = DriverManager.getConnection(props.getProperty("DB2_URL")+"packageset", props); 

-? ERROR: com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException: [jcc][t4][2030][11211][3.62.56] A communication error occurred during operations on the connection's underlying socket, socket input stream, or socket output stream. Error location: Reply.fill() - socketInputStream.read (-1). Message: Connection reset. ERRORCODE=-4499, SQLSTATE=08001

posted this

Have an answer?

JD

Please login first before posting an answer.