Written by

Question prashant na · Apr 15, 2020

How do I connect to a database using JDBC filter

hi all,

I am looking to make a JDBC connection to my Intersystems Cache using the JDBC driver 2.0.0.

I see the connection format is as "

   jdbc:Cache://<host>:<port>/<namespace>

"

What I really want to do is filter additionally by a certain database, i.e. connect my consuming application to a database under the namespace.

how can I do that? what will be the format

Comments

Scott Roth · Apr 15, 2020

First start off by looking at the following documentation...

What you use for your connection string all depends on the driver you are using. In the past I have used Microsoft, Oracle, and jTDS JDBC drivers. Currently I am using jTDS because it allows me to use integrated Authentication. so my strings are a little long...

jdbc:jtds:sqlserver://(server name):(port)/(database);instance=xx;domain=xxxx;useNTLMv2=true;cacheMetaData=true;prepareSQL=2;

is just an example.

Scott

0
prashant na  Apr 15, 2020 to Scott Roth

Hi Scott,

thanks for your response. I have looked at the given documentation. What I am missing is in the connection string, where do I specify the database/Schema as a filter? This format only connects to a namespace , can I pass an additional parameter of the schema-name or database name ?

   jdbc:Cache://<host>:<port>/<namespace>
0
Scott Roth  Apr 15, 2020 to prashant na

I would believe the only way to put a schema filter in would be within your query and not in the connection string.

0
Eduard Lebedyuk · Apr 15, 2020

I advice solving your problem by tightening security.

Your app user should have access only to the tables needed for the application to run.

If the user doesn't have any additional/admin roles, he won't see any other tables.

0