Examples of DbConnection


Examples of de.mhus.lib.sql.DbConnection

      }
    }
  }
 
  private void query(IConfig config, LinkedList<CaoElement> list) throws Exception {
    DbConnection con = ((DbCaoConnection)getConnection()).getPool().getConnection();
    String staName = config.getExtracted("statement");
    DbStatement sta = null;
    if (staName != null) {
      sta = con.getStatement(staName);
    } else {
      sta = con.createStatement(config.getString("sql",null));
    }
   
    String tbl = config.getExtracted("table");
    DbMetadata m = ((DbApplication)getApplication()).getMetadata(tbl);
   
    DbResult res = sta.executeQuery(attributes);
    while (res.next()) {
      list.add(new DbData(this,m,res,config));
    }
    res.close();
    con.close();
  }
View Full Code Here

Examples of de.mhus.lib.sql.DbConnection

      }
     
    }
    private DbResult createResult() throws Exception {
      DbResult res = null;
      DbConnection con = ((DbCaoConnection)getConnection()).getPool().getConnection();
      DbStatement sth = con.createStatement(queryString);
      if (sth.execute(  ((DbApplication)getApplication()).getMapping() )) {
        res = sth.getResultSet();
      } else {
        res = new MutableResult();
        ((MutableResult)res).addColumnName("count");
View Full Code Here

Examples of galena.addins.modules.database.DB.DBConnection

        return false;
      }
    }
  }
  protected void logPresence(PresenceWrapper oldWrapper) {
    DBConnection db = this.db.getDBConnection(false);
    int id = db.sendInsert(null,"goim_presence_log","jid,resource,mode,start,\"end\"",
        StringUtils.parseBareAddress(oldWrapper.presence.getFrom()).toLowerCase(),
        StringUtils.parseResource(oldWrapper.presence.getFrom()),
        oldWrapper.presence.getMode().toString(),
        oldWrapper.date,
        new Date());
    db.commit();
    Iterator i = oldWrapper.presence.getExtensions();
    while(i.hasNext()) {
      PacketExtension ex = (PacketExtension)i.next();
      if(ex instanceof GameStatusExtension) {
        GameStatusExtension status = (GameStatusExtension)ex;
        String gameId = status.gameId;
        String destination;
        if(status.gameId.equals("lfss2")) {
          destination = status.atts.get("servername");
        } else {
          destination = GameStatusExtension.formatSocketAddress(status.target);
        }
        db.sendInsert(null,"goim_server","game,destination,presence",gameId,destination,id);
        db.commit();
      }
    }
    db.close();
  }
View Full Code Here

Examples of mungbean.protocol.DBConnection

    }

    @Override
    protected DBConnection createNew() {
        checkPoolStatus();
        return new DBConnection(server);
    }
View Full Code Here

Examples of net.sf.xbus.technical.database.DBConnection

          .getValueOptional("Base", "Journal", "DBConnection");
      if (dbConnectionName == null)
      {
        dbConnectionName = DBConnection.UNNAMED;
      }
      DBConnection dbcon = DBConnection.getInstance(dbConnectionName);

      if ((dbcon.getUrl() != null)
          && (dbcon.getUrl().startsWith("jdbc:hsqldb")))
      {
        dbcon.executeUpdate("shutdown compact");
      }
    }
    catch (XException e)
    {
      System.exit(1);
View Full Code Here

Examples of net.sf.xbus.technical.database.DBConnection

          .getValueOptional("Base", "Journal", "DBConnection");
      if (dbConnectionName == null)
      {
        dbConnectionName = DBConnection.UNNAMED;
      }
      DBConnection dbCon = DBConnection.getInstance(dbConnectionName);

      ResultSet result = dbCon.executeRead(sqlBefehl);
      Vector list = new Vector();

      while (result.next())
      {
        ReadJournal journal = new ReadJournal();
View Full Code Here

Examples of org.apache.turbine.util.db.pool.DBConnection

        // Check for Transaction support.  Give warning message if
        // IDBroker is being used with a database that does not
        // support transactions.
        String dbName = tMap.getDatabaseMap().getName();
        DBConnection dbCon = null;
        try
        {
            dbCon = TurbineDB.getConnection(dbName);
            transactionsSupported = dbCon.getConnection()
                .getMetaData().supportsTransactions();
        }
        catch (Exception e)
        {
            transactionsSupported = false;
View Full Code Here

Examples of org.apache.turbine.util.db.pool.DBConnection

//        synchronized(tMap)  see comment in the getNextIds method
//        {
            if (adjustQuantity)
                checkTiming(tableName);

            DBConnection dbCon = null;
            try
            {
                String databaseName = dbMap.getName();

                // Get a connection to the db by starting a
                // transaction.
                if (transactionsSupported)
                {
                    dbCon = BasePeer.beginTransaction(databaseName);
                }
                else
                {
                    dbCon = TurbineDB.getConnection(databaseName);
                }
                Connection connection = dbCon.getConnection();

                // Write the current value of quantity of keys to grab
                // to the database, primarily to obtain a write lock
                // on the table/row, but this value will also be used
                // as the starting value when an IDBroker is
View Full Code Here

Examples of org.apache.turbine.util.db.pool.DBConnection

        {
            quantity = (BigDecimal)quantityStore.get(tableName);
        }
        else
        {
            DBConnection dbCon = null;
            try
            {
                String databaseName = tableMap.getDatabaseMap().getName();

                // Get a connection to the db
                dbCon = TurbineDB.getConnection(databaseName);
                Connection connection = dbCon.getConnection();

                // Read the row from the ID_TABLE.
                BigDecimal[] results = selectRow(connection, tableName);

                // QUANTITY column.
View Full Code Here

Examples of org.apache.turbine.util.db.pool.DBConnection

     */
    public static Schema initTableSchema(String tableName,
                                         String dbName)
    {
        Schema schema = null;
        DBConnection db = null;

        try
        {
            if (dbName == null)
            {
                // Get a connection to the db.
                db = TurbineDB.getConnection();
            }
            else
            {
                // Get a connection to the db.
                db = TurbineDB.getConnection( dbName );
            }

            Connection connection = db.getConnection();

            schema = new Schema().schema(connection, tableName);
        }
        catch(Exception e)
        {
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.