Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java/SQL connection problems

 
Bob Backlund
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sure this is a quite common problem but thus far have not been about to find a solution.

Using JDBC I have setup a connection with a SQL7 database, the connection is successful, but when I try to runa SQL search within a JSP (a simple SELECT * FROM Table1 query) I get the following:

java.sql.SQLException: Invalid object name 'Table1'.

Any suggestions?

Cheers

KS
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try database_name.table_name maybe you are running your query against bad database.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dont know about SQL 7 but in ORACLE sometimes we need to specify the schema_name.table_name, this is the case when we logged in by some other schema.

try it out. it may work for you.
 
Srinivasan Anantharaman
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check if "Table1" is created and existing.
 
Prashant Jain
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
refer to the table as

<<DBOName>>.<<databasename>>.<<ObjectName>>
If it still doesnt work then the table you are looking for doesnt exist.You could also consider verifying the rights of the user you are using to connect.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic