The opaque type
The following JDBC client application installs the class Circle2 (which
is packaged in Circle2.jar) as an opaque type
in the system catalog. Applications can then use the opaque type Circle2 as
a data type in SQL statements:
import java.sql.*; import java.lang.reflect.*; public class PlayWithCircle2 { String dbname = "test"; String url = null; Connection conn = null; public static void main (String args[]) { new PlayWithCircle2(args); } PlayWithCircle2(String args[]) { // ----------- // Getting URL // ----------- if (args.length == 0) { System.out.println("\n***ERROR: connection URL must be provided " + "in order to run the demo!"); return; } url = args[0]; // -------------- // Loading driver // -------------- try { System.out.print("Loading JDBC driver..."); Class.forName("com.informix.jdbc.IfxDriver"); } catch (java.lang.ClassNotFoundException e) { System.out.println("\n***ERROR: " + e.getMessage()); e.printStackTrace(); return; } try { conn = DriverManager.getConnection(url); } catch (SQLException e) { System.out.println("URL = '" + url + "'"); System.out.println("\n***ERROR: " + e.getMessage()); e.printStackTrace(); return; } System.out.println();