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

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

 
Siegfried Heintze
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 34410
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Wendy Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic