Showing posts with label administer javadb. Show all posts
Showing posts with label administer javadb. Show all posts

Tuesday, 27 December 2011

Using the ij Tool

The ij tool enables you to connect to a running JavaDB server and execute scripts and queries against a database.
The command to use the ij tool is:


java �jar derbyrun.jar ij


Commands of the ij Tool
CommandDescriptionDriverLoads the specified JDBC driver.ProtocolSets the specified protocol to use for connecting to a database.ConnectEstablishes a connection with a database.Set ConnectionSwitches from the existing connection to a different connection specified with a connection name.Show ConnectionsLists all active connections.DisconnectDisconnects the current connection, a connection specified by a connection name, or all active connections.Show SchemasLists all schemas present in the current database.Show TablesLists all tables present in the current database.Show ViewsLists all views present in the current database.Show ProceduresLists all stored procedures present in the current database.Show IndexesLists all indexes present in a specified table.DescribeDisplays information about columns, such as column name and data type, for a specified table.rumitCommits the current transaction.RollbackRolls back the current transaction.

To view run time information for JavaDB

java �jar derbyrun.jar server runtime

Stop JavaDB

java �jar derbyrun.jar server shutdown

Ping JavaDB

The JavaDB Environments

Embedded: Allows only a single application to access a database at one time.
In the embedded environment, no network access occurs.
When you load a JDBC driver from a Java program, JavaDB automatically starts in the embedded environment.
Client/server: Allows multiple applications to connect to JavaDB over the network.
To start JavaDB in the client/server environment, you need to use the server command line tool of JavaDB.

JavaDB Tools

Java SE 6 contains various tools that you can use to start, stop, access, and administer JavaDB.
Some of the JavaDB tools are:
  1. server: Starts the JavaDB database.
  2. ij Represents a JDBC scripting tool.
  3. You can use ij to run scripts against a JavaDB database.
  4. You can also use ij to run SQL queries.
  5. You can use ij to access JavaDB running in both the embedded and client/server environments.
  6. sysinfo: Displays information about the JavaDB version and the environment.
  7. dblook: Generates and stores the Data Definition Language (DDL) to a file.
  8. In Java SE 6, the server, ij, sysinfo, and dblook tools are packaged in the derbyrun.jar file.
  9. You can locate the derbyrun.jar file in the <JAVA_HOME>/db/lib directory.