• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in fetching data from sql server 2005

 
Maheswaran Devaraj
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,


I have tried to fetch the values from my table named sample. It contains one field, it was named id. While I try to fetch the data It will throw exception. Name of my datasource is Sample.

my code is following:
-----------------------




The exception is:
--------------------
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'sample'.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(Unknown Source)
at db.ConnectUrl.main(ConnectUrl.java:18)


help me to resolve the problem.

Thanks and Regards,
Mahes
 
Rob Spoor
Sheriff
Pie
Posts: 20546
56
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't have a table called sample inside that datasource.

Moving to JDBC.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...and why are you using the JDBC-ODBC bridge? You'll have fewer issues if you use a proper type 4 driver.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic