Friday, October 5, 2012

Derby Installation Tutorial

Hi i would to share with you derby installation tutorial in the linux platform the procedure is very simple.

Follow the below steps to make life much easier. Actually it becomes much easy when you go through the installation document.

Download the tar or zip of derby installation package from the url:Download Derby installation package.

1.Extract the Package in directory Database\db-derby-10.9.1.0-bin\docs\pdf\getstart Here the document gives you complete installation steps,but still i would like share the derby installation on unbuntu machine.
2. set environment variables in unbuntu terminal as below open the terminal make sure you are in the home location. Set the derby_home environment variable to path where you have extracted the Derby bin package .Command to set the derby_home environment variable

sudo pico .bashrc export DERBY_HOME=/home/gamma/Database/db-derby-10.9.1.0-bin b.

Add the derby_home/bin directory to the PATH environment variable inorder to run the sql scripts from the script location export PATH=$PATH:$derby_home/bin

3.Add the Derby Jar files to the CLASSPATH environment variable export CLASSPATH=$CLASSPATH:$derby_home/lib/derby.jar: $derby_home/lib/derbytools.jar:$derby_home/lib/derbyclient.jar: $derby_home/lib/derbyrun.jar How to Start with Derby Tool
4.The derbyrun.jar file is a special JAR file that is used to invoke/start the Network Server and Derby tools

home>:~/Database/db-derby-10.9.1.0-bin$ java -jar $derby_home/lib/derbyrun.jar server start

ij: this is an interactive tool used to connect to a database and perform SQL commands.
The ij program is executed from the command prompt. Executing ij will open the program and show you the ij prompt.

The following shows a sample execution of the ij program.
home:~/Database/db-derby-10.9.1.0-bin/$ ij ij version 10.9

ij> You have now started the ij program and are ready to connect to a database.

5.At the ij prompt you can connect to a database by issuing the connect command. This command takes a string identifying the location of the database to connect to.
The following example connects to the database

  ij> CONNECT 'jdbc:derby://localhost:1527/Mydb;user=tute;password=db';    

Connected to derby database perform ur Sql operations

No comments:

Post a Comment