开发者

invalid object name 'tableName' error

I am using SQL Server 2005. I am getting this error while connecting with sql server from java. Using SQL Server Authentication. Login:sa Table name=Task

[microsoft][odbc sql server driver][sql server]invalid object name 'Task' 

Below is the connection code in java file in try-catch bloc开发者_如何学Gok.

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection("jdbc:odbc:dsndbPMA;");
st=conn.createStatement();
query="select * from Task";
rs=st.executeQuery(query);  

Can anyone please help me where I have mistaken?


It sounds like the connection isn't attaching to the correct database. Can you posy the connection string? Does the connection string specify the data source?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜