This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java/SQL connection problems