开发者

exception with jdbc

开发者 https://www.devze.com 2023-02-26 20:59 出处:网络
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:

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:

  1. The object doesn't belong to dbo
  2. The object does belong to dbo, but the user you logged in as doesn't have permission to view it
  3. 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'
0

精彩评论

暂无评论...
验证码 换一张
取 消