File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes How to execute SQL Query in Squirrel on Oracle Database server? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to execute SQL Query in Squirrel on Oracle Database server?" Watch "How to execute SQL Query in Squirrel on Oracle Database server?" New topic
Author

How to execute SQL Query in Squirrel on Oracle Database server?

Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 381
I posted this on the squirrel mailing list yesterday and since I have not received a response, I thought I would try here too.
I'm running squirrel 3.4.0 and oracle database 11g.

I can now connect to my oracle database in my linux guest and I see a nice display of tabs. Previously I had a bad syntax for my connection string and was not connecting. Here is my connection string for squirrel:

jdbc:oracle:thin:@192.168.1.131:1521:orcl

(My connection string for java is and my program executes my query correctly.)

When I try to expand "TABLE" I'm expecting a list of tables and I see no tables. What is wrong?

When I click on the SQL tab I enter the following SQL:



I get
Error:Closed Connection
SQL State: 08003
ErrorCode: 17008

However, my java program executes this SQL query correctly with the connection string below.

What am I doing wrong?
Thanks
Siegfried



This fragment of java code successfully connects from my windows 7 host to my oracle linux guest running the oracle database:
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30356
    
150

The first thing to try is the SQL editor view in Squirrel. If the query works there, it will confirm you have access to that table. You probably do since it works from your Java program, but it is a good thing to confirm.

Next, is "siegfried" the schema owner for those tables? The way to tell is to run


If these don't run, the problem is likely that you are only looking at tables from the "current owner" in Squirrel and need to look for an all users type menu option.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

This is the connection string i use for oracle in squirrel you seem to be missing quite a few of the things I have
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

There are several supported formats of the Oracle connection string. The one Siegfried is using is perfectly OK.

Our Oracle FAQ page has a link describing the formats of Oracle connection strings. I believe you're using the TNSName format, Wendy.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to execute SQL Query in Squirrel on Oracle Database server?