• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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

 
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
author & internet detective
Posts: 42173
937
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Anderson gave himself the promotion. So I gave myself this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic