问题
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:
- 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.
Current package set cat be specified in the URL like this:
jdbc:db2://50010/DB2T:specialRegisters=CURRENT QUERY ACCELERATION=ALL;currentPackageSet=F9DERWSl;
来源:https://stackoverflow.com/questions/53202192/how-do-i-achieve-queryaccelearation-all-and-packageset-using-java-jdbc