JDBC connection to azure sqlserver db

JDBC connection to the database was successful. unable to get the list of tables available in the source DB under resource scope. Can you please help?

Hi Viji,

Welcome to the community.

When you received this error, were you creating a new datasource or did you click on an existing one? If it was an existing one, what UI did you use to create it (Designer, Studio, CLI)?

In what database do you expect to find tables?

Does the datasource include the databaseName=<yourcatalog> property in the JDBC connection string?

Did you add (or did the existing data source have) the sql.default.schema or sql.schemas data source options?

-Paul

Hi Paul,

I was creating a new datasource

I expect to find the tables from Azure SQLserver DB. I took the jdbc connection string from azure portal.

Does the datasource include the databaseName=<yourcatalog> property in the JDBC connection string?
yes. below is the connection string I used. I tried to replace database to databaseName, the connection was successful.

jdbc:sqlserver://{servername}:{port};database={db Name};user={username@dbname};password={your_password_here};encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;

Tables are not loaded in the default schema. I used to query the data by schemaname.table name from sqlserver management studio.

In my testing just now, I have a MS SQL Server with databases (aka catalogs) catalog1 and catalog2.

I use the connection string:
dbc:sqlserver://mssql.myserverid.us-east-1.rds.amazonaws.com:1433;databaseName=catalog1;trustServerCertificate=true

And I set sql.schemas=catalog2.dbo.

Stardog picks up catalog1 from the connection string and catalog2 from the sql.schemas property.

From there I see tables from both DBs (catalog1.table1, catalog2.table2, etc).

It's possible I'm seeing something different because I'm using a traditional SQL Server instance rather than the Azure-hosted version. Let me know if the configuration above doesn't help and I can look into finding an Azure instance.

-Paul

Hi Paul, thanks for the inputs. i updated sql.schemas from stardog studio. Now im able to query the tables. Thanks very much.

1 Like