Java/MSSQL:java.sql.SQLException 无效的对象名称“TableName" [英] Java/MSSQL: java.sql.SQLException Invalid object name 'TableName'

查看:29
本文介绍了Java/MSSQL:java.sql.SQLException 无效的对象名称“TableName"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 Java 应用程序从旧服务器移动到新服务器.该应用程序在 Tomcat 上运行,使用 Microsoft SQL Server 作为后端 DB,并使用数据源 (ODBC) 中定义的系统 DSN 来决定连接到何处.旧服务器使用Windows 2000/SQL Server 2000,新服务器使用Windows 2003/SQL Server 2005.

I'm trying to move a java application from an old server to a new server. The application runs on Tomcat, uses Microsoft SQL Server as the backend DB, and used a system DSN defined in Data Sources (ODBC) to decide where to connect to. The old server used Windows 2000/SQL server 2000, the new server uses Windows 2003/SQL Server 2005.

服务器之间的 ODBC 定义是相同的,并且定义了要使用的 DB.

The ODBC definition is identical between servers, and defines the DB to use.

在新服务器上,当用户尝试登录时,stdout.log 中会出现以下内容:

On the new server when a user tries to login the following appears in the stdout.log:

正在检查用户错误:java.sql.SQLException:[Microsoft][ODBC SQL Server 驱动程序][SQL Server]无效的对象名称UserTable".

数据库中确实存在名为UserTable的表,但通过管理界面显示为dbo.USerTable".

A table called UserTable does exist in the DB, but shows as "dbo.USerTable" through the management interface.

MSSQL 中是否有某个设置我应该调整以使其对dbo"感到满意.前缀丢失了,还是我错过了其他东西?

Is there a setting somewhere in MSSQL I should be adjusting to make it happy with the "dbo." prefix being missing, or is there something else I've missed?

使用了 Windows 身份验证,作为故障排除步骤,Public 和 Guest 角色已被授予对数据库的完全权限.

[edit] Windows authentication is used, and the Public and Guest roles have been given full rights to the DB as a troubleshooting step.

推荐答案

数据库登录是否不同?dbo前缀"只是对象在其下定义的模式.因此,如果您的 ODBC 连接器使用 dbo 凭据登录该对象,则该对象应该在其默认架构中.

Are the DB logins different? the dbo "prefix" is just the schema that the object is defined under. So if your ODBC connector is using the dbo credentials to login that object should be in it's default schema.

这篇关于Java/MSSQL:java.sql.SQLException 无效的对象名称“TableName"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆