70353

Mule database connector url format for DB2 not correct

Question:

I am trying Mule's Database Connector to connect to a DB2 database but I couldn't figure out the correct format for the database URL. I created a Generic Database Configuration global element with Database URL

jdbc:db2://db01.dev.myserver.org:50000/mydb;User=test;Password=secret

And Driver

com.ibm.db2.jcc.DB2Driver

When I click Test Connection, it says

Test connection failed: Cannot get connection for URL jdbc:db2://db01.dev.myserver.org:50000/mydb;User=test;Password=secret : [ibm][db2][jcc][t4][10205][11234] Null userid is not supported.

How shall I put the username and password in the URL?

Thanks!

Answer1:

JDBC properties, such as user and password need to be separated from the rest of the URL with a colon (":"), and each property, including the last one, should be terminated with a semicolon (";"). I suspect the property names may be also case-sensitive. So

jdbc:db2://db01.dev.myserver.org:50000/mydb:user=test;password=secret;

Reference: <a href="http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.apdv.java.doc/src/tpc/imjcc_rjvdsprp.html?lang=en" rel="nofollow">http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.apdv.java.doc/src/tpc/imjcc_rjvdsprp.html?lang=en</a>

Recommend

  • Assembly je, jns, jle which register does it use?
  • IBM data studio not connecting to local DB2 databases
  • How do I achieve queryaccelearation=all and packageset using Java JDBC?
  • I am getting “ Operation timed out. ERRORCODE=-4499, SQLSTATE=08001” connecting to remote DB2
  • What is a Partial Flag Stall?
  • Forward Engineering MySQL Workbench Error 1064
  • How can i read the db in my android app which i've modified in my pc and copied back to my app&
  • How to use ADOX to connect to existing Access database
  • SqlBulkCopy.WriteToServer() keep getting “connection is closed”
  • java.lang.ClassNotFoundException: com.mysql.jdbc.Driver. [duplicate]
  • Httpd.conf multiple VirtualHost sections (was: Mono ASP.NET MVC AutoHosting issues)
  • Having trouble removing punctuation and upper case letters? (Beginner)
  • Warning: mail(): Failed to Receive in
  • Masterpage CSS link can't resolve ~
  • PostgreSQL - make two transactions run at the same time
  • Using embedded database with Flyway and jOOQ in Maven for continuous integration
  • Whats wrong with this C shell script?
  • Easy convert betwen SQLAlchemy columns and data types?
  • Connect to remote MySQL via Python
  • Why is my SqlPackage DeployReport returning an empty report?
  • Using LINQ with IBM i
  • xpages partial - full search
  • how to automatically enter password when using ssh?
  • Sybase Error Implicit Conversion from datatype 'VARCHAR' to 'INT' not allowed
  • MongoError: Incorrect arguments
  • Django rest serializer Breaks when data exists
  • ImageMagick, replace semi-transparent white with opaque white
  • Cannot connect to cassandra from Spark
  • Display issues when we change from one jquery mobile page to another in firefox
  • Deselecting radio buttons while keeping the View Model in synch
  • Cross-Platform Protobuf Serialization
  • JSON with duplicate key names losing information when parsed
  • Alternatives to the OPTIONAL fallback SPARQL pattern?
  • Jquery - Jquery Wysiwyg return html as a string
  • Turn off referential integrity in Derby? is it possible?
  • Authorize attributes not working in MVC 4
  • Busy indicator not showing up in wpf window [duplicate]
  • UserPrincipal.Current returns apppool on IIS
  • Python/Django TangoWithDjango Models and Databases
  • Net Present Value in Excel for Grouped Recurring CF