Package ejp

Examples of ejp.DatabaseManager


         */
        // DatabaseManager dbm = DatabaseManager.getJndiDefinedDatabaseManager("contacts", 15,
        //                                                                     "jdbc/contacts", null, null);

        // HSQL in memory database (for example only)
        DatabaseManager dbm = DatabaseManager.getDatabaseManager("contacts", 5,
                                                                 "org.hsqldb.jdbcDriver",
                                                                 "jdbc:hsqldb:mem:contacts",
                                                                 "sa", "");
       
        dbm.executeUpdate("CREATE MEMORY TABLE simple_storage (" +
                          "account varchar(40) NOT NULL," +
                          "container varchar(40) NOT NULL," +
                          "object varchar(40) NOT NULL," +
                          "data longvarbinary NOT NULL," +
                          "PRIMARY KEY (account, container, object))");
View Full Code Here


          {
            // Normal JNDI definition for a website
            //DatabaseManager dbm = DatabaseManager.getDatabaseManager("customers", 15, "jdbc/users");
         
            // HSQL in memory database
            DatabaseManager dbm = DatabaseManager.getDatabaseManager("users", 5, "org.hsqldb.jdbcDriver", "jdbc:hsqldb:mem:users", "sa", "");
           
            dbm.executeUpdate("create memory table users(username varchar(30), password varchar(30), first_name varchar(40), last_name varchar(40), roles varchar(100))");
           
            dbm.saveObject(new User("admin", "b8fOPfDKETezXTCgqbtF", "Admin", null, "admin, create, delete"));
            dbm.saveObject(new User("jsmith", "njiaJzLtntWp6abHfRtU", "John", "Smith", "user"));
           
            config.getServletContext().setAttribute("databaseManager", dbm);
          }
        catch (Exception e)
          {
View Full Code Here

          {
            // Normal JNDI definition for a website
            //DatabaseManager dbm = DatabaseManager.getDatabaseManager("customers", 15, "jdbc/customers");
         
            // HSQL in memory database
            DatabaseManager dbm = DatabaseManager.getDatabaseManager("customers", 5, "org.hsqldb.jdbcDriver", "jdbc:hsqldb:mem:customers", "sa", "");
           
            dbm.executeUpdate("CREATE MEMORY TABLE CUSTOMERS(FIRST_NAME VARCHAR(30), LAST_NAME VARCHAR(30), COMPANY_NAME VARCHAR(40), PHONE VARCHAR(15), EMAIL VARCHAR(255))");
            dbm.executeUpdate("INSERT INTO CUSTOMERS VALUES('John','Smith','EasierJava Inc.','561-1233','jsmith@EasierJava.com')");
           
            config.getServletContext().setAttribute("databaseManager", dbm);
          }
        catch (Exception e)
          {
View Full Code Here

public class Customers extends RequestHandler
  {
    // default request loads customer database into list for the view
    public String request() throws Exception
      {
        DatabaseManager dbm = AppUtils.getDatabaseManager(getServerInterface());
        List<Customer> customers = (ArrayList<Customer>)dbm.loadObjects(new ArrayList<Customer>(), Customer.class);

        getServerInterface().addViewObject("customersList", customers);
       
        return getServerInterface().getUrl("view");
      }
View Full Code Here

TOP

Related Classes of ejp.DatabaseManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.