DbConsole


Author: Dale Anson
Version: 2.0.1

Starting DbConsole

Change to the 'dbconsole' directory. This is the directory that contains DbConsole_2.0.1.jar.

Execute:

bash$ java -jar DbConsole_2.0.1.jar

You can also list directories containing drivers on the command line with the -lib parameter:

bash$ java -jar DbConsole_2.0.1.jar -lib /path/to/driver:/path/to/another/driver

When you first start DbConsole, it will check for configured databases and present you a list to choose from. Enter the number corresponding to the database and hit the "Enter" key. You will then be prompted for the user name and password to use to connect to the database. You can change to another database or add a new database without exiting DbConsole by typing "\db" at the prompt, DbConsole will show you the same list and let you pick a different database. You can also log into the same database as a different user.

Here's a screen shot of starting DbConsole, choosing a database, and logging in:

$ java -jar DbConsole_2.0.1.jar > +---------------------------------------------------------------+ | Welcome to DbConsole 2.0.1, the database agnostic interactive | | terminal. | +---------------------------------------------------------------+ | Type: | | \? or \h or \help for help | | \db Change database or add new database | | \config Edit a database configuration | | \intro to display this intro | | \v or \version or \about for version | | \copyright for distribution terms | | \q to quit DbConsole | +---------------------------------------------------------------+ > > +-----------------------------+ | Select database: | +-----------------------------+ | 1) HR | | 2) Football | | 3) Finance | | 4) Employee Expenses | | 5) warehouse | | 6) QA | | 7) Other | | x) Cancel | +-----------------------------+ Choose: (Football)

The default choice is the last database that you used, so you can just hit 'Enter' if you just want to reconnect. Next you'll be asked for a username to use to connect to the database:

+----------------------------------+ | Select username for connection: | +----------------------------------+ | 1) danson | | 2) Other | | x) Cancel | +----------------------------------+ Choose: (danson)

Again, the default choice is the last username you used for connecting to this database. You can set up a new user by choosing 2, the 'Other' option. DbConsole will attempt to connect to the database and will display some basic connection information once the connection is made:

Connecting... +--------------------------------------------+ | Database info: | +--------------------------------------------+ | Url: jdbc:postgresql://localhost/football2 | | Driver: org.postgresql.Driver | | Username: danson | | Database Product Name: PostgreSQL | | Database Product Version: 7.4.3 | +--------------------------------------------+ > _

Now you can start sending sql to the database.