Closed deceiver08 closed 4 years ago
What is the JDBC driver (name and version) that you are using?
mssql-jdbc-8.2.2.jre8.jar
This is the master database. Not the db I specify in the connection string.
I am not familiar with how this driver works, but just by reading its documentation, seems that the URL parameter is called "databaseName": https://docs.microsoft.com/en-us/sql/connect/jdbc/using-the-jdbc-driver?view=sql-server-ver15
JasperReports is not doing anything with the URL and it passes it to the driver, which is responsible to make use of it, the way it sees fit.
You should try use the driver with some other Java applications to see if it works there. I suggest a Java SQL tool such as Squirrel. http://squirrel-sql.sourceforge.net/
So let's put aside JRL and JSS for a moment and see if the driver actually works as advertised.
Hi @teodord. Yeah I caught that. I use the databaseName parameter. Sorry for the confusion.
I did as you suggested and Squirrel connects just fine using the driver. As you can see, in Squirrel both databases are presented, whereas in Jasper Studio its just master. I am literally using the exact same connection strings between the two software?
If you are aware of a different java driver that will work with an Azure Sql database in Studio, let me know. At the moment, this java driver is the latest and greatest from Microsoft directly.
Looks like this Squirrel test did not help us much after all. From what I can see, the fact that you provided the databaseName to the Squirrel URL did not make it see only that database. Squirrel will see all databases anyway. Probably even if you don't specify a databaseName at all, right?
You are right. I stripped out the databaseName parameter and Squirrel still presented me with both databases. I tried the same thing in Studio and it still shows just master. So if they are both using the same driver, is something in Studio hardcoded to filter or only present one db regardless of driver?
I finally got this working. I dropped and recreated the user I was trying to connect with and it worked. Looks like it was a sql server security issue, probably with the assigned login role.
Thanks for letting us know.
When I try to create a data adapter to a Azure SQL database, the connection always goes to the master database rather than the database I specify in the jdbc url using the databaseName parameter (I also tried just "database" too for the parameter and it didn't work either). The user I am using does have rights to the database called out. I can't move forward.