Showing posts with label derby. Show all posts
Showing posts with label derby. Show all posts

Tuesday, 27 December 2011

Connect command of ij to establish a connection with a database

The connect command loads a JDBC driver to establish the connection.
The command to establish a connection with a sample database is:


connect "jdbc:derby:sample";

New to Java 6 is a lightweight database called Derby.

Derby is a product of the Apache Database project.
Derby is a transactional, relational database.
Derby provides a small footprint on disk.
Deployment is much easier because Derby supports storage of a database archived in a JAR file.
Derby allows you to simply distribute the JAR file.

JavaDB URLs

To connect to an existing JavaDB database using the embedded driver:


jdbc:derby:<databaseName>;<URLAttributes>


  1. host: Specifies the computer name or Internet Protocol address where Java DB is running. If Java DB is running on the same computer as that of the client, you can use localhost or 127.0.0.1 as the value of the host option.
  2. Port: Specifies the port number used by JavaDB to accept incoming requests.
  3. databaseName: Represents the name of the database to connect with.