Using from Tools
There are many JDBC based tools in the Java community that can be used to administrate or operate general database systems. These tools can also be used to operate the KingswaySoft JDBC Driver Pack to connect to your API data when properly configured. In this section we will walk you through the process of integrating our JDBC drivers with popular DB tools such as DbVisualizer, Squirrel SQL, and DBeaver. We will also cover how to establish the connection and make use of their table editors for data editing and saving, as well as executing SQL commands.
DbVisualizer
DbVisualizer is a very popular DB tool in the Java community. With proper configuration, DbVisualizer allows you to connect to your API data just like you are working with a traditional database, including the ability to make direct data editing to tables, and executing SQL commands from within the tool.
Adding JDBC Driver
- Navigate to Tools > Driver Manager... in the DbVisualizer toolbar.
- Click the "+" button and choose Custom as the template.
- Provide a name for the driver.
- Enter "jdbc:kingswaysoft:" in the URL Format field.
- Click the '+' button in the Driver Artifacts and JAR Files section, then select Add Files. Navigate to the lib folder of the installation directory and select the driver JAR file kingswaysoft.jdbc.jar.
Creating a Database Connection
- Navigate to Database > Create Database Connection in the DbVisualizer toolbar.
- The Driver Name selector will appear; double-click the name of the JDBC driver defined earlier.
- Set the Database Type to Generic.
- Set Driver Type to the name given to the JDBC driver.
- Input the complete JDBC URL in the Database URL field. The format is jdbc:kingswaysoft:, followed by connection properties in a semicolon-separated list of name-value pairs. Users can use the Connection Manager to generate a connection URL. For more information, refer to the Building the JDBC URL section in the documentation for each driver.
- Users can view and modify the connection settings defined by the JDBC driver by clicking on 'Properties'. For a detailed guide on using specific connection settings, refer to the Connection Settings section in the documentation for each driver.
- Click Connect.
Discovering Schemas and Querying Data You can now browse data and execute SQL queries, follow these steps to do so:
- To access available tables, expand the connection tree nodes for the database, schema, and tables or views under the Databases tab.
- Right-click on a table to open it in a new tab to browse data and metadata.
- To execute SQL queries, navigate to SQL Commander > New SQL Commander. Then select the Database Connection, Database, and Schema from the available menus.
Note: If you update the JDBC driver JAR, restart DbVisualizer before proceeding.
Squirrel SQL
Squirrel SQL is another popular tool in the community, which can be used to access your API data in a similar fashion.
To add the JDBC Driver, follow these steps
- Open the Add Driver wizard by clicking the plus icon in the Drivers pane.
- Enter a user-friendly name for the driver in the Name box.
- Enter "jdbc:kingswaysoft:" in the Example URL box.
- Switch to the Extra Class Path tab and click Add.
- Locate and select the kingswaysoft.jdbc.jar for the driver from the lib subfolder of the installation directory using the file explorer.
- Click List Drivers to populate the Class Name menu with the class name for the driver, which should be com.kingswaysoft.jdbc.Drivers.
To create the JDBC Data Source, follow these steps
- In the Aliases pane, click the plus icon.
- In the Add Alias wizard:
- Name: Provide a name for the alias
- Driver: Select the driver definition you created earlier.
- URL: Input the complete JDBC URL in the URL field. The format is jdbc:kingswaysoft:, followed by connection properties in a semicolon-separated list of name-value pairs. Users can utilize the Connection Manager to generate a connection URL. For specific information, refer to the Building the JDBC URL section in the documentation for each driver.
- User Name: If required, enter a username for authentication. This will be added to the JDBC URL.
- Password: If required, enter a password for authentication. This will also be added to the JDBC URL.
- Alternatively, you can add the properties in the Driver Properties dialog:
- Select the "Use Driver Properties" checkbox.
- In the Specify column, select the checkboxes for the required connection properties and specify their corresponding values.
- Click Connect in the dialog that appears after you click OK to test the connection.
Discovering Schemas and Querying Data You can now browse data and execute SQL queries, follow these steps to do so:
- Right-click the alias in the Aliases pane and select Connect. Once the metadata is loaded, a new tab for the data source will appear.
- Navigate to the Objects subtab to explore schema information, including available tables and views.
- To view table data and metadata, select the desired table on the Objects tab. You can access the table data in the Content tab.
- To execute an SQL query, switch to the SQL tab, enter your query, and click Run SQL (the runner icon).
DBeaver
DBeaver is yet another popular DB tool that can be used to access your API data when used with the JDBC Driver Pack.
Adding the JDBC Driver to DBeaver
- Open DBeaver and navigate to the "Database" menu. Select "Driver Manager", then click "New" to open the "Create New Driver" form.
- Enter a user-friendly name for the driver in the Name box.
- Enter "jdbc:kingswaysoft:" in URL Template field.
- In the Libraries tab, click Add File and locate the corresponding kingswaysoft.jdbc.jar for the driver from the lib subfolder of the installation directory.
- Click Find Class and select "com.kingswaysoft.jdbc.Drivers" from the list that appears. If it is not present, you can instead save the driver and then select 'Edit' to modify the driver. Afterwards, select 'Libraries' and click 'Find Class' again to locate the driver class.
Creating a JDBC Data Source in DBeaver
- In the main DBeaver window, click Database > New Connection.
- Select the driver definition you created from the dialog.
- Input the complete JDBC URL in the JDBC URL field. The format is 'jdbc:kingswaysoft:', followed by connection properties in a semicolon-separated list of name-value pairs. Users can utilize the Connection Manager to generate a connection URL. For specific information, refer to the Building the JDBC URL section in the documentation for each driver.
- On the next page of the wizard, click the Driver Properties tab.
- Enter any necessary connection properties to connect to API. For a detailed guide on using specific connection settings, refer to the Connection Settings section in the documentation for each driver.
Discovering Schemas and Querying Data You can now browse data and execute SQL queries, follow these steps to do so:
- Expand the node for the connection to access the database metadata.
- Right-click on a table and select Edit Table to browse table metadata and modify table data.
- To execute an SQL query, navigate to the SQL Editor > New SQL Editor and choose the connection you created. You can then enter queries.
Note: DBeaver version 23.0 and later includes an OpenJDK 17 bundle, but it may lack the javax.xml.crypto package, leading to a ClassNotFoundException when using JDBC drivers. To avoid this, install a local JDK and modify the dbeaver.ini file by adding '-vm JDK_HOME\bin' at the top of the file, right after the comment section (if present), where JDK_HOME is the path to your JDK installation (e.g., C:\Program Files\Java\jdk-17).