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
Command | Description |
Driver | Loads the specified JDBC driver. |
Protocol | Sets the specified protocol to use for connecting to a database. |
Connect | Establishes a connection with a database. |
Set Connection | Switches from the existing connection to a different connection specified with a connection name. |
Show Connections | Lists all active connections. |
Disconnect | Disconnects the current connection, a connection specified by a connection name, or all active connections. |
Show Schemas | Lists all schemas present in the current database. |
Show Tables | Lists all tables present in the current database. |
Show Views | Lists all views present in the current database. |
Show Procedures | Lists all stored procedures present in the current database. |
Show Indexes | Lists all indexes present in a specified table. |
Describe | Displays information about columns, such as column name and data type, for a specified table. |
Commit | Commits the current transaction. |
Rollback | Rolls back the current transaction. |
20.37.Java DB Derby | ||||
20.37.1. | New to Java 6 is a lightweight database called Derby. | |||
20.37.2. | The JavaDB Directory Structure | |||
20.37.3. | The JavaDB Environments | |||
20.37.4. | JavaDB Drivers | |||
20.37.5. | JavaDB URLs | |||
20.37.6. | JavaDB Tools | |||
20.37.7. | You can use the server tool to start JavaDB in a network client environment. | |||
20.37.8. | Ping JavaDB. | |||
20.37.9. | To view run time information for JavaDB, you can use the following command: | |||
20.37.10. | To stop JavaDB, you can use the following command: | |||
20.37.11. | Using the ij Tool | |||
20.37.12. | You can use the connect command of ij to establish a connection with a database | |||
20.37.13. | Viewing and Switching Connections | |||
20.37.14. | Working with Tables | |||
20.37.15. | To view the structure of the Employee table | |||
20.37.16. | Using the sysinfo Tool | |||
20.37.17. | Connect to Java DB (Derby) with org.apache.derby.jdbc.EmbeddedDriver | |||
20.37.18. | Connect to Derby database | |||
20.37.19. | The SQL script for creating the Employee Table |