Examples of Database


Examples of application.database.Database

  public Database db;
  public UserInterface ui;
 
  public void run() {
    try {
      db = new Database("test.db");
      ui = new UserInterface(db);
     
      ui.show();
           
    } catch (Exception e) {
View Full Code Here

Examples of application.outils.Database

import application.vues.VueFenetrePrincipale;

public class ApplicationDvdIut {

  public static void main(String[] args) {
    Database db = new Database(GLOBAL.G_DRIVER, GLOBAL.G_URL);
   
    ModeleVideotheque modele;
    modele = new ModeleVideotheque(db);
    VueFenetrePrincipale vue = new VueFenetrePrincipale(modele);
    vue.setVisible(true);
View Full Code Here

Examples of be.xtnd.commons.db.Database

            CommonsI18n.tr("Are you sure you want to exit the application?"),
            CommonsI18n.tr("Quit confirmation"),
            JOptionPane.YES_NO_OPTION,
            JOptionPane.QUESTION_MESSAGE);
          if (response == JOptionPane.YES_OPTION) {
            try{new Database().disconnect();}catch(Exception ex){/*just in case...*/}
            System.exit(0);
          }
      }
        });
    Container contentPane = this.getContentPane();
View Full Code Here

Examples of bm.db.Database

            throws VirtualMachineException
    {
        final int id = checkMethod( methodName, args );
        if( id != -1 )
        {
            Database db = (Database)
                    target.getAttachment( "db" );
            try
            {
                switch( id )
                {
                    case CONNECT:
                        if( db == null )
                        {
                            db = Database.connect( Conversor.toString( args[0] ) );
                            target.setAttachment( "db", db );
                        }
                        return null;

                    case CREATE:
                        if( db == null )
                        {
                            db = Database.create( Conversor.toString( args[0] ) );
                            target.setAttachment( "db", db );
                        }
                        return null;

                    case GET_TABLE:
                        if( db != null )
                        {
                            final String tableName = Conversor.toString( args[0] );
                            final Table table = db.getTable(
                                    tableName
                            );
                            if( table != null )
                            {
                                Hashtable tables = (Hashtable)
                                        target.getAttachment( "tables" );
                                if( tables == null )
                                {
                                    tables = new Hashtable( 10 );
                                    target.setAttachment( "tables", tables );
                                }
                                Instance t = (Instance) tables.get( tableName );
                                if( t == null )
                                {
                                    t = getVirtualMachine().newInstance( "Table" );
                                    t.setAttachment( "table", table );
                                    t.setAttachment( "parent", target );
                                    tables.put( tableName, t );
                                }
                                return t;
                            }
                            else
                            {
                                return null;
                            }
                        }
                        else
                        {
                            return null;
                        }

                    case CREATE_TABLE:
                        if( db != null )
                        {
                            final Table table = (Table)
                                    args[0].getAttachment( "table" );
                            db.createTable( table );
                            Hashtable tables = (Hashtable)
                                    target.getAttachment( "tables" );
                            if( tables == null )
                            {
                                tables = new Hashtable( 10 );
                                target.setAttachment( "tables", tables );
                            }
                            Instance t = (Instance) tables.get( table.getName() );
                            if( t == null )
                            {
                                t = getVirtualMachine().newInstance( "Table" );
                                t.setAttachment( "table", table );
                                t.setAttachment( "parent", target );
                                tables.put( table.getName(), t );
                            }
                            return t;
                        }
                        else
                        {
                            return null;
                        }

                    case START:
                        if( db != null )
                        {
                            db.start();
                        }
                        else
                        {
                            return null;
                        }

                    case PACK:
                        if( db != null )
                        {
                            db.pack();
                        }
                        else
                        {
                            return null;
                        }

                    case DROP:
                        if( db != null )
                        {
                            db.drop();
                        }
                        else
                        {
                            return null;
                        }

                    case REPAIR:
                        if( db != null )
                        {
                            db.repair();
                        }
                        else
                        {
                            return null;
                        }

                    case IS_DAMAGED:
                        return db != null ?
                               Conversor.toInstance(
                                       getVirtualMachine(),
                                       new Boolean( db.isDamaged() )
                               ) :
                               null;

                    case OPEN:
                        if( db != null )
                        {
                            db.open();
                        }
                        else
                        {
                            return null;
                        }

                    case CLOSE:
                        if( db != null )
                        {
                            db.close();
                        }
                        else
                        {
                            return null;
                        }

                    case SHUTDOWN:
                        if( db != null )
                        {
                            db.shutdown();
                        }
                        else
                        {
                            return null;
                        }

                    case SANITY_CHECK:
                        if( db != null )
                        {
                            db.sanityCheck();
                        }
                        else
                        {
                            return null;
                        }

                    case GET_NAME:
                        return db != null ?
                               Conversor.toInstance(
                                       getVirtualMachine(),
                                       db.getName()
                               ) :
                               null;

                    case GET_VER_MAJOR:
                        return db != null ?
                               Conversor.toInstance(
                                       getVirtualMachine(),
                                       new Short( db.getVersionMajor() )
                               ) :
                               null;

                    case GET_VER_MINOR:
                        return db != null ?
                               Conversor.toInstance(
                                       getVirtualMachine(),
                                       new Short( db.getVersionMinor() )
                               ) :
                               null;

                    default:
                        return null;
View Full Code Here

Examples of br.org.scadabr.dnp34j.master.session.database.Database

  }

  public void init() throws Exception {
    phyLayer = new PhyLayer(this);

    database = new Database();
    appRcv = new AppRcv(this);
    appSnd = new AppSnd(this);
    transpLayer = new TransportLayer(this);
    lnkRcv = new LnkRcv(this);
    lnkSnd = new LnkSnd(this);
View Full Code Here

Examples of ch.agent.crnickl.api.Database

      // expensive method
      Set<Integer> schemaIds = new HashSet<Integer>(schemas.size());
      for (UpdatableSchema s : schemas) {
        schemaIds.add(getId(s));
      }
      Database database = schemas.iterator().next().getSurrogate().getDatabase();
      try {
        find_entity_with_series = open(FIND_ENTITY_WITH_SERIES, database, find_entity_with_series);
        find_entity_with_series.setInt(1, ss.getNumber());
        ResultSet rs = find_entity_with_series.executeQuery();
        while (rs.next()) {
          if (schemaIds.contains(rs.getInt(1))) {
            Surrogate entityKey = makeSurrogate(database, DBObjectType.CHRONICLE, rs.getInt(1));
            Schema schema = database.getChronicle(entityKey).getSchema(true); // hope caching is on
            if (schemaIds.contains(getId(schema)))
              result.add(entityKey);
          }
        }
      } catch (Exception e) {
View Full Code Here

Examples of ch.pollet.jzic.timezone.Database

            System.out.println();
            System.out.println(jsap.getHelp());
            System.exit(0);
        }

        Database database = new Database();
        Parser parser     = new Parser(database);
        Compiler compiler = new Compiler(database);
        Writer writer = new Writer(database);

        parser.parse(config.getStringArray("inputFiles"));
View Full Code Here

Examples of com.Acrobot.Breeze.Database.Database

        } catch (ClassNotFoundException e) {
            e.printStackTrace();
            ChestShop.getBukkitLogger().severe("You haven't got any SQLite JDBC installed!");
        }

        Database database = new Database("jdbc:sqlite:" + ChestShop.loadFile("items.db").getAbsolutePath());
        yaml = new Yaml(new YamlConstructor(), new YamlRepresenter(), new DumperOptions());

        try {
            Statement statement = database.getConnection().createStatement();
            statement.executeUpdate("PRAGMA user_version = 1"); //We'll be able to change it later if we need to
            statement.close();
        } catch (SQLException e) {
            e.printStackTrace();
        }

        try {
            table = database.getTable("items");
            table.create("id INTEGER PRIMARY KEY, code VARCHAR UNIQUE ON CONFLICT IGNORE");
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

Examples of com.btmatthews.maven.plugins.inmemdb.Database

   *
   * @throws MojoFailureException
   *             If there was an error executing the goal.
   */
  public void execute() throws MojoFailureException {
    final Database database = getDatabase();
    if (database != null) {
      database.shutdown(this);
    }
  }
View Full Code Here

Examples of com.caucho.db.Database

  @Override
  public java.sql.ResultSet executeQuery(String sql)
    throws SQLException
  {
    Database db = getDatabase();
   
    if (db == null)
      throw new SQLException(L.l("statement is closed"));

    Query query = db.parseQuery(sql);
   
    java.sql.ResultSet rs = executeQuery(query, getQueryContext());

    return rs;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.