Examples of prepareStatement()


Examples of com.alibaba.druid.pool.DruidPooledConnection.prepareStatement()

        PreparedStatementHolder stmtHoler_3;
        PreparedStatementHolder stmtHoler_4;
       
        // sql_0连续执行两次
        {
            DruidPooledPreparedStatement stmt_0 = (DruidPooledPreparedStatement) conn.prepareStatement(sql_0);

            Assert.assertFalse(stmt_0.getPreparedStatementHolder().isPooling());

            stmt_0.close();
            Assert.assertEquals(1, stmtPool.size());
View Full Code Here

Examples of com.cloud.utils.db.Transaction.prepareStatement()

    //Use update method with category instead
    @Override @Deprecated
    public boolean update(String name, String value) {
      Transaction txn = Transaction.currentTxn();
    try {
      PreparedStatement stmt = txn.prepareStatement(UPDATE_CONFIGURATION_SQL);
      stmt.setString(1, value);
      stmt.setString(2, name);
      stmt.executeUpdate();
      return true;
    } catch (Exception e) {
View Full Code Here

Examples of com.cloud.utils.db.TransactionLegacy.prepareStatement()

        ResultSet rs = null;
        HostVO host = null;
        TransactionLegacy txn = TransactionLegacy.currentTxn();

        try {
            pstmt = txn.prepareStatement(sql);
            pstmt.setLong(1, poolId);
            rs = pstmt.executeQuery();
            while (rs.next()) {
                long id = rs.getLong(1);
                host = hostDao.findById(id);
View Full Code Here

Examples of com.fathomdb.jdbc.JdbcConnection.prepareStatement()

      String sql = "SELECT data FROM service_authorizations WHERE service=? and project=?";

      List<ServiceAuthorization> items = Lists.newArrayList();

      PreparedStatement ps = connection.prepareStatement(sql);
      ResultSet rs = null;
      try {
        ps.setInt(1, serviceId);
        ps.setInt(2, projectId);
        rs = ps.executeQuery();
View Full Code Here

Examples of com.knowgate.jdc.JDCConnection.prepareStatement()

      switch (IdType) {
        case 1:
          sSQL = "SELECT "+sColList+" FROM " + DB.k_mime_msgs + " WHERE " + DB.gu_mimemsg + "=?";
          if (DebugFile.trace) DebugFile.writeln("Connection.prepareStatement("+sSQL+")");

          oStmt = oConn.prepareStatement(sSQL, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
          oStmt.setString(1, sMsgId);
          break;
        case 2:
          sSQL = "SELECT "+sColList+" FROM " + DB.k_mime_msgs + " WHERE " + DB.id_message + "=?";
          if (DebugFile.trace) DebugFile.writeln("Connection.prepareStatement("+sSQL+")");
View Full Code Here

Examples of com.mysql.jdbc.Connection.prepareStatement()

    connex = getConnection();
    String insert = "INSERT INTO `user`(`id`, `pseudo`, `nom`, `prenom`, `solde`, `psswd`) VALUES ( ?, ?, ?, ?, ?, ?) ";

    try {
      // inscription
      PreparedStatement preStat = (PreparedStatement) connex
          .prepareStatement(insert);

      preStat.setInt(1, 0);
      preStat.setString(2, utilisateur.getPseudo());
      preStat.setString(3, utilisateur.getNom());
View Full Code Here

Examples of com.salesforce.phoenix.jdbc.PhoenixConnection.prepareStatement()

        assertTrue(descriptor.hasCoprocessor(ServerCachingEndpointImpl.class.getName()));
        admin.close();
        
        int rowCount = 5;
        String upsert = "UPSERT INTO " + tableName + "(id,col1,col2) VALUES(?,?,?)";
        PreparedStatement ps = conn1.prepareStatement(upsert);
        for (int i = 0; i < rowCount; i++) {
            ps.setString(1, Integer.toString(i));
            ps.setInt(2, i+1);
            ps.setInt(3, i+2);
            ps.execute();
View Full Code Here

Examples of com.sun.star.sdbc.XConnection.prepareStatement()

    {
        m_database.executeSQL("DROP TABLE \"TEST1\" IF EXISTS");
        m_database.executeSQL("CREATE TABLE \"TEST1\" (\"ID\" integer not null primary key, \"col2\" varchar(50) )");

        final XConnection connection = m_database.defaultConnection();
        final XPreparedStatement prep = connection.prepareStatement("INSERT INTO \"TEST1\" values (?,?)");
        final XParameters para = (XParameters) UnoRuntime.queryInterface(XParameters.class, prep);
        for (int i = 1; i <= MAX_TABLE_ROWS; ++i)
        {
            para.setInt(1, i);
            para.setString(2, "Test" + i);
View Full Code Here

Examples of connectivity.tools.sdb.Connection.prepareStatement()

    {
        m_database.executeSQL("DROP TABLE \"TEST1\" IF EXISTS");
        m_database.executeSQL("CREATE TABLE \"TEST1\" (\"ID\" integer not null primary key, \"col2\" varchar(50) )");

        final Connection connection = m_database.defaultConnection();
        final XPreparedStatement prep = connection.prepareStatement("INSERT INTO \"TEST1\" values (?,?)");
        final XParameters para = UnoRuntime.queryInterface( XParameters.class, prep );
        for (int i = 1; i <= MAX_TABLE_ROWS; ++i)
        {
            para.setInt(1, i);
            para.setString(2, "Test" + i);
View Full Code Here

Examples of de.kilobyte22.app.kibibyte.Database.prepareStatement()

            if (bot.useYaml) {
                HashMap<String, String> perms_ = bot.yamlEngine.load(new File("permissions.yaml"));
                perms_.put(nick, tmpperms);
                bot.yamlEngine.writeYaml(new File("permissions.yaml"), perms_);
            } else {
                PreparedStatement s = database.prepareStatement("SELECT * FROM permissions WHERE server = ? AND nickserv = ?");
                s.setString(1, bot.getServer());
                s.setString(2, nick);
                try {
                    //s.executeQuery().next();
                    s = database.prepareStatement("UPDATE permissions SET permissions=? WHERE server = ? AND nickserv = ?");
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.