SQLJ application programming

Writing an SQLJ application has much in common with writing an SQL application in any other language.

In general, you need to do the following things:
  • Import the Java™ packages that contain SQLJ and JDBC methods.
  • Declare variables for sending data to or retrieving data from data server tables.
  • Connect to a data source.
  • Execute SQL statements.
  • Handle SQL errors and warnings.
  • Disconnect from the data source.

Although the tasks that you need to perform are similar to those in other languages, the way that you execute those tasks, and the order in which you execute those tasks, is somewhat different.