How do I achieve queryaccelearation=all and packag

2019-09-02 16:08发布

问题:

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.example.com:50010/DB2T:user=xxxxx;password=yyyyy;specialRegisters=CURRENT QUERY ACCELERATION=ALL;. ERRORCODE=-4461, SQLSTATE=42815

Thanks, Rasheed SK

回答1:

  1. java.util.Properties object passed to java.sql.Driver.connect() cannot be overridden by URL

You must not specify user and password twice - in the URL and in the properties. Exclude them from either place.

  1. Current package set cat be specified in the URL like this:

    jdbc:db2://50010/DB2T:specialRegisters=CURRENT QUERY ACCELERATION=ALL;currentPackageSet=F9DERWSl;



标签: java db2