Search code examples
javamongodbdatasourceweblogic12ccdata-drivers

How to create a MongoDb data source with cdata Driver in weblogic12.2.1


I want create MongoDb data source in weblogic12.2.1 and use Connect to MongoDB from a Connection Pool in WebLogic but have a error to create this data source. my config is:

Driver Class Name: cdata.jdbc.mongodb.MongoDBDriver

URL: jdbc:mongodb:Server=localhost;Port=27017;Database=test;

this is my error. Error Picture

I think my UserName or Password is in correct but when use another configuration like:

Driver Class Name: cdata.jdbc.mongodb.MongoDBDriver

URL: jdbc:mongodb

but have same error. So i think mongodb jdbc not known by weblogic. have some idea


Solution

  • You're seeing this error because you're setting the username property using the WebLogic interface.

    DON'T DO THIS

    In order to connect to MongoDB using the CData JDBC Driver, you need to set the User property in the JDBC URL, though you can still use the WebLogic user interface for the Password property:

    jdbc:mongodb:Server=<server>;Port=<port>;Database=<database>;User=<username>;...