Hello everyone,
I am experimenting with serving MS SQL Server database views using ERDDAP. The ultimate goal of this project is to explore whether ERDDAP might help my institution (MBARI) make a large proportion of its data publicly available in a variety of formats.
At the moment, I think ERDDAP is having trouble reading my test view. If I enter the following into GenerateDatasetsXml.sh (note, not real username and password):
EDDTableFromDatabase.generateDatasetsXml
url=jdbc:jtds:sqlserver://
perseus.shore.mbari.org:1433/EXPDdriver=net.sourceforge.jtds.jdbc.Driver
connectionProperties=user,user,password,password
catalog=
schema=dbo
table=DocRickettsRovctdData
orderBy=
I get this output:
EDDTableFromDatabase.makeConnection via DriverManager + datasets.xml info
Success! time=188ms
getting primaryKey list
java.sql.SQLException: The database name component of the object qualifier must be the name of the current database.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:677)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:505)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:1032)
at net.sourceforge.jtds.jdbc.JtdsDatabaseMetaData.getPrimaryKeys(JtdsDatabaseMetaData.java:1301)
at gov.noaa.pfel.erddap.dataset.EDDTableFromDatabase.generateDatasetsXml(EDDTableFromDatabase.java:1301)
at gov.noaa.pfel.erddap.GenerateDatasetsXml.doIt(GenerateDatasetsXml.java:510)
at gov.noaa.pfel.erddap.GenerateDatasetsXml.main(GenerateDatasetsXml.java:990)
This suggests to me that ERDDAP was able to establish a connection, but that the database name is incorrect. It seemed like this might be related to capitalization/lack of capitalization as suggested in the ERDDAP docs, so I've tried several options with no luck (all caps, no caps, etc).
I wanted to share this issue and ask two questions:
1. Do you agree that the connection information is probably OK, and that the problem is likely related to the actual schema/table name?
2. Has anyone encountered this before? Do you have suggestions on what else I might try?
Many thanks,
Diana