mongodb / mongo-jdbc-driver

JDBC Driver for MongoDB Atlas SQL interface
Apache License 2.0
37 stars 33 forks source link

Passing database via connection string doesn't work #33

Closed OiNutter closed 11 months ago

OiNutter commented 3 years ago

With JDBC you should be able to specify the database via the connection string, not by having to pass it in the info argument. At the moment this will cause a NullPointerException as it fails the Preconditions check in MongoStatement.

rychipman commented 3 years ago

@OiNutter could you provide an example of a connection string with database that you expect the JDBC driver to be able to handle?

mmpataki commented 2 years ago

@rychipman I have submitted a PR, can you please review it

RaoulHofmann commented 1 year ago

Is there a workaround for this? I need to use the driver with DataSourceProperties but can't pass in the database

osowskit commented 1 year ago

+1 to this request. Ideally the database parameter can be passed in the URL parameters

mmpataki commented 1 year ago

Few of our (Informatica) customers want to use this driver with our product for data profiling and I am asked to supply the Jar. Attaching the jar I built for anyone who needs it

mongodb-jdbc-1.0.4-SNAPSHOT.zip

jchemburkar commented 11 months ago

This feature is now supported, as of this commit. Similar to mongodb uris, this will come after the host / port. For example jdbc:mongodb://<host>:<port>/<database>?authSource=<auth db>. Please note that if the database is specified in the connection string and in the info, the latter will take precedence.