File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Java/SQL connection problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Java/SQL connection problems" Watch "Java/SQL connection problems" New topic

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?



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

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

Joined: Aug 19, 2004
Posts: 29
refer to the table as

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.
I agree. Here's the link:
subject: Java/SQL connection problems
It's not a secret anymore!