AJAX Tricks and Prototype
derby.jar
library to your project. It
was installed under glassfish-v2/javadb/lib
./* * To change this template, choose Tools | Templates * and open the template in the editor. */ package edu.sc.cse; import org.apache.derby.jdbc.*; import java.sql.Connection; import java.sql.DriverManager; public class DatabaseConnector { public static Connection getConnection() { Connection con = null; String driver = "org.apache.derby.jdbc.EmbeddedDriver"; try { Class.forName(driver).newInstance(); } catch (Exception e) { System.out.println("Failed to load mySQL driver."); return null; } try { //AJAX is the database name. //This is for empty username and password //Otherwise append ?username=jmvidal&password=usc con = DriverManager.getConnection("jdbc:derby://localhost:1527/AJAX"); } catch (Exception e) { e.printStackTrace(); } return con; } }
/*To import my zipcodes.del table */ CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE (null,'ZIPCODES','/full-path-name/zipcodes.del',null,null,null,0) /* To export a table */ CALL SYSCS_UTIL.SYSCS_EXPORT_TABLE (null,'ZIPCODES','/full-path-name/zipcodes.del',null,null,null)
delete from
"TABLENAME"
INSERT INTO TABLE (USERNAME,PASSWORD)
VALUES ('jmvidal','usc')
6 of 16