PROJECT 1 DerbyDB Creator -SQL scripting tool for Apache Derby
'DerbyDB Creator' is a SQL scripting tool with Graphical User Interface for
Apache derby databases.
Apache derby is an RDBMS (Relational Database Management
System) developed by the Apache Software Foundation that can be embedded in Java programs. The core of the technology, Derby's database engine, is a full-functioned
relationally embedded database-engine, supporting JDBC and SQL as programming APIs.
Before we move further Have a look at this video which shows the functioning of DerbyDB Creator
1) What is DerbyDB Creator?
DerbyDB Creator as a Graphical User Interface to access databases of
apache derby and modify the databases by providing various SQL commands for
the apache derby database. It is a replacement for 'ij' command-line tool of
Apache org. This application has been created using JDBC(Java Database
Connectivity) and the interface is created using Java Swing and Java
AWT.
2)Features of Derby DB Creator:-
- Option to connect to the database by specifying the host, port number, and location of the database.
- Options to disconnect and exit from the application.
- Text area to throw various SQL commands and a button to run those commands.
- Panel at the bottom which shows the status and errors in the SQL command.
- A center panel which displays the table and data in that table.
- A side panel that displays the list of tables available in the database. When we double click on a table name from the list then the data in that table will get displayed on the center panel.
- Last but a very big feature of this application is - It has an option of RAD (Rapid Application Development) settings and a button 'Create Data Layer'. This option allows us to create the code of "Data Layer" automatically.
3)Installation and Using Application:
- Download the zip file from this GitHub link: DerbyDB Creator.
- Unzip it to any folder anywhere you want and when you open it then go to 'dist' folder in this folder there are two folders - DerbyDBCreator and java-derby.
- The first one is an interface and another is the java-derby database system.
- Set <your location>\java-derby\ to the environment variables.
- Now open command prompt and type - "startnetworkserver" . This will start the apache-derby server. If everything goes correct then you will see this:
- Now start another command prompt on that go to the folder by cd command where you want to create database then type 'ij'. If you do it right You will see this:
- On this ij prompt create a database by this command:
- We have created a database and now we will access that database using derbyDB Creator.
Starting DerbyDB Creator:
- Move to folder DerbyDBCreator in dist folder and there you will find derbyDBCreator.bat file double click on it and then the interface will be shown up.
-
Click on RDBMS menu item then click on connect now a window will be
shown up there you will have to enter the host (localhost or any
remote server IP), port number(default it is 1527), and a path to the
database(where my database is located from server here-/myDB). Do
Confirm that server is running otherwise start it. The window will
look like this:
- Click on connect when the application will connect to the server then at the bottom we will see 'start your job' and the list of tables will be displayed at the side panel which is there in the database.
- Now in the text area type the SQL statements and run it.
To generate Data Layer of the table:
- To create the Data layer of a table, first, click on RAD settings and specify the package name and the location where you want to create that package.
- Select a table by single-clicking it from the list of tables and then click generate DL. This will create a complete data layer of selected table i.e. DAO (Data Access Object) class, DTO(Data Transfer Object) class, interfaces of these classes, and exception class.
- This will generate the whole data layer.
Very good. Well explained.
ReplyDelete