exception with jdbc
i'm a beginner with jdbc, i have a DB in sql server and i connected to a java app code when i run it i resive this:
run: The SQL connection开发者_如何学JAVA was successful. JDBC Driver error:Invalid object name 'dbo.categories'.
categories is an entity in my sql server DB i really can't solve it by myself,every thing is seems to be right!!!
Post your connection URL. I think it means that your database name is incorrect.
I think the URL ought to look more like this:
jdbc:sqlserver://host:port;databaseName=foo
Leave off the dbo.
and just use categories
as the name.
There are a number of possible reasons for this. These could include:
- The object doesn't belong to dbo
- The object does belong to dbo, but the user you logged in as doesn't have permission to view it
- You're connecting to the wrong database
Finding the owner of a table is something like this in SQL Server:
SELECT table_catalog, table_schema
FROM INFORMATION_SCHEMA.TABLES
WHERE table_name = 'TABLE'
精彩评论