I use Squirrel SQL to connect to a JavaDB/Derby database on my desktop. I can run SQL queries.
But how can I list all tables in the database? And preferably all column and column types.
I use Squirrel SQL to connect to a JavaDB/Derby database on my desktop. I can run SQL queries.
But how can I list all tables in the database? And preferably all column and column types.
You can do it easily from the GUI. After you open your session, click the Objects tab, then expand the tree. Expand the db, schema, and then table nodes, and you'll see all of your tables. If you click on a particular table node, a table will open to the right. By clicking the Columns tab, you can get the column names, types, and other meta data.
Or are you looking for SQL commands?
Sometimes I noticed that doing the above may not result in the tables showing. Before I figured this out, my table node will not be expandable and I can never get a list of the tables.
After a lot of searching on the internet, I learnt that you need to choose the schema from the catalog drop down box located at the upper left portion of the squirrel sql client before the icons to be able to get the table list for that particular schema.
Hope that helps.
I know this is quite an old question. I was stuck with this for the last 3 days (google search results didn't help) I'm using Squirrel 3.4 and had to connect to a old DB2 database. I could connect to the DB but could not see the tables for 3 days. Finally got it, here is what worked for me -
We had this issue using SQuirreL SQL Client with Amazon Redshift PostgreSQL.
A short-term solution just was to use:
SELECT * FROM information_schema.columns
RJ.'s solution worked for some machines (thanks) and not others
In the end we realized it was a driver issue. We needed postgresql-8.4-...jar from http://jdbc.postgresql.org/download.html#others