*
The moose likes JDBC and the fly likes Java/SQL connection problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Java/SQL connection problems" Watch "Java/SQL connection problems" New topic
Author

Java/SQL connection problems

Bob Backlund
Ranch Hand

Joined: Jun 05, 2003
Posts: 51
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


Cheers!
David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
Try database_name.table_name maybe you are running your query against bad database.


SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
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

Joined: Oct 07, 2004
Posts: 1
Check if "Table1" is created and existing.
Prashant Jain
Greenhorn

Joined: Aug 19, 2004
Posts: 29
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.
 
Don't get me started about those stupid light bulbs.
 
subject: Java/SQL connection problems