![]() |
![]() |
![]() |
![]() |
JDBC Operations
There are many common operations which involve databases. JDBC Operations includes many of the more common ones, including
- Connect to a Database Directly...
- Connect to a database using the DriverManager...
- Close a connection to a database...
- Perform a Search...
- Create a statement object...
- Execute an SQL statement which changes the database...
- Execute an SQL statement which queries the database...
- Process a result set returned from a query...
- Process MetaData from a result set...
- Process MetaData from a database connection...
- Close a statement object named
Before any interaction is possible with a Database, a connection must be made to it. The name and URL of the driver must be known, as well as the username and password (if needed). The DriverManager is a convienent way to open a connection, but the drivers must have been loaded on the primordial classpath (the classpath used to start Simplicity).
It is possible to manually close a connection to a database when it is no longer being used.
The Perform A Search option of the Code Sourcerer will write the code to perform a search, and will analyze the result set, returning a String array array (String[][]) of the results. This option is recommended for most searches. If more control over the type of query and the analysis of the results is desired, the remaining options may be used instead.
A Statement Object is needed before the database may be queried or modified. This should be closed when no longer needed.
SQL statements which change the database include INSERT, DELETE, and UPDATE.
SELECT statements are SQL statements which query the database. They are also known as "searches".
An SQL Query returns a "result set" which may be analyzed row by row. The Process a result set... option provides methods to do so.
In addition to the data of a result set, "MetaData", or data about the result set, is available. There is also MetaData about a database connection.
Data Representations, Inc. http://www.datarepresentations.com support@datarepresentations.com sales@datarepresentations.com |
![]() |
![]() |
![]() |
![]() |