<< NetBeans IDE Configuration - TOC >>
Using eclipse, we will develop an example application that will document key structures, and demonstrate several API calls. This chapter will cover Eclipse for CSQL client development.
This section has the following sections:
The configuration of Eclipse for client access to a database is by adding JDBC Driver to the IDE.
To demonstrate, we shall create an example table in the CSQL database and establish a JDBC connection to the CSQL database from the Eclipse IDE. Next, we shall insert, retrieve, update and delete and display the example data in the GUI SQL client.
$cd eclipse
$./eclipse
We can start configuring by performing the below steps,
Go to File in main toolbar, Select New from the drop down menu, a pop-up titled Project appears. Now follow the below steps:
Click on Project titled, a new dialog box will appear Select the titled Java Project from the drop down menu Click Next, a new window will create Type a project name in the Project Name box. (In Figure 2a. – it is CsqlTest) Click on Finish, then Yes.
After creating a new project (CsqlTest), a number application can be run.
The name of the JDBC Driver is CsqlJdbcDriver.jar, which needs to be set in the project properties to interact with CSQL. It is explained in the below steps.
Right Click on CsqlTest (what we created as our new project) in your left hand pan under Package Explorer menu. Go to Properties title and click on that, it will show a dialog box. Click on Java Build Path > Libraries > Add External JARS button (Illustrated in Figure 3.) In a new dialog box, select the CsqlJdbcDriver.jar file, which will be under /csql/install/lib directory.
We will create an application named CsqlExample.java under CsqlTest project, which will create a table and perform the insert, update and delete operation to access CSQL database.
Follow the below steps to perform the above action;
Double click on CsqlTest, which is present on your left hand pan. Right click on Src Go to New Class, and give your application name in Name box. Click on Finish
Now write the java code to access the database data in CsqlExample.java application.
Connection String and Flag for to connect to JDBC Driver:
Class.forName(“csql.jdbc.JdbcSqlDriver”); Connection con = DriverManager.getConnection(“jdbc:csql”, “root”, “manager”);