When using extra parameters for the connection in a JDBC URL, the complete URL should end with a semi-colon. However, other drivers for other RDBMS do not need the las semi-colon; actually, the semi-colon is only used for key/value separation, not termination.
The Db2 driver uses StringTokenizer, and it generates an error like:
com.ibm.db2.jcc.am.SqlSyntaxErrorException: [jcc][4.26.14] Invalid database URL syntax: jdbc:db2://mydb2server:50000/sample:user=db2inst1;password=db2inst1. ERRORCODE=-4461, SQLSTATE=42815
Because the code asks the StringTokenizer the next token ending with a semi-colon. It should ask a token ending with "a semi-colon or an end of line."
When configuring applications that builds the URL for JDBC, like Pentaho, one should but an extra semi-colon in the last parameter to make it work.
The Db2 documentation does not mention that the URL should end with extra parameters - https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.5.0/com.ibm.db2.luw.apdv.java.doc/src/tpc/imjcc_rjvdsprp.html
|Who would benefit from this IDEA?||Developers, DBA|
How should it work?
TheJDBC URL should work with the following possibilities:
Ending with and without semi-colon.
|Priority Justification||Configuring the DB2 JDBC driver is harder than other RDBMS|
|IBM's success depends on gathering feedback from customers like yourself. Aha Ideas Portal is the third party tool through which IBM Offering Managers gather feedback from customers such as yourself.|
|IBM is a global organization with business processes, management structures, technical systems and service provider networks that cross borders. As such, the information collected through Aha Ideas Portal (Customer Name, Customer Email Address) will be stored by them in the United States, and handled only as per IBM's instructions and policies. Your data (Name and Email Address) will NOT be shared with other IBM customers.|
|In order to safeguard your information in Aha, do not leave your workstation unattended while using this application, log off after using it, and print only if necessary. If you need to make a hardcopy, remember to pick up the print-out immediately, keep it under lock, and destroy it immediately when no longer needed.|
|NOTICE TO EU RESIDENTS: per EU Data Protection Policy, if you wish to remove your personal information from the IBM ideas portal, please login to the ideas portal using your previously registered information then change your email to "email@example.com" and first name to "anonymous" and last name to "anonymous". This will ensure that IBM will not send any emails to you about all idea submissions|