Init
First we need to open a connection to a database by providing the c-treeACE Database Engine with a user name, password and the database name. Below is the code for Initialize(): // // Initialize() // // Perform the minimum requirement of logging onto the c-tree Server // private static void Initialize () {
System.out.println("INIT");
try {
// load the driver Class.forName ("ctree.jdbc.ctreeDriver");
// connect to server System.out.println("\tLogon to server...");
conn = DriverManager.getConnection ("jdbc:ctree:6597@localhost:ctreeSQL", "ADMIN", "ADMIN");
// create statement handles stmt = conn.createStatement(); } catch (SQLException e) {
Handle_Exception(e); } catch (Exception e) {
Handle_Exception(e); } } |
|||