Examples of prepareStatement()


Examples of java.sql.Connection.prepareStatement()

        final Connection conn = getConnection("concurrentAlter");
        Statement stat = conn.createStatement();
        Task t = new Task() {
            public void call() throws Exception {
                while (!stop) {
                    conn.prepareStatement("select * from test");
                }
            }
        };
        stat.execute("create table test(id int)");
        t.execute();
View Full Code Here

Examples of java.sql.Connection.prepareStatement()

        conn0.getWarnings();
        conn0.clearWarnings();
        conn0.setAutoCommit(false);
        conn0.getAutoCommit();
        conn0.getAutoCommit();
        PreparedStatement prep0 = conn0.prepareStatement("select max(ID) from CLOB_ENTITY");
        ResultSet rs0 = prep0.executeQuery();
        rs0.next();
        rs0.getLong(1);
        rs0.wasNull();
        rs0.close();
View Full Code Here

Examples of java.sql.Connection.prepareStatement()

        rs0.getLong(1);
        rs0.wasNull();
        rs0.close();
        prep0.close();
        conn0.getAutoCommit();
        PreparedStatement prep1 = conn0
                .prepareStatement("insert into CLOB_ENTITY (DATA, CLOB_DATA, ID) values (?, ?, ?)");
        prep1.setNull(1, 2005);
        StringBuilder buff = new StringBuilder(10000);
        for (int i = 0; i < 10000; i++) {
            buff.append((char) ('0' + (i % 10)));
View Full Code Here

Examples of l2p.database.ThreadConnection.prepareStatement()

    FiltredPreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT MAX(endban) AS endban FROM bans WHERE obj_Id=? AND endban IS NOT NULL");
      statement.setInt(1, ObjectId);
      rset = statement.executeQuery();
      if(rset.next())
      {
        Long endban = rset.getLong("endban") * 1000L;
 
View Full Code Here

Examples of liquibase.database.jvm.JdbcConnection.prepareStatement()

            JdbcConnection conn = (JdbcConnection) database.getConnection();

            try {
                Statement stmt = conn.createStatement();
                PreparedStatement insertStmt =
                        conn.prepareStatement("insert into HCredentials "
                                + "(account_id, type, user, email, creationDate, lastChanged, versionNum) values"
                                + "(?, ?, ?, ?, ?, ?, ?)");
                ResultSet rset =
                        stmt.executeQuery("select acc.id, acc.username, p.email, acc.creationDate, acc.lastChanged "
                                + " from HAccount acc, HPerson p"
View Full Code Here

Examples of marauroa.server.db.DBTransaction.prepareStatement()

        continue;
      }

      DBTransaction writeTransaction = TransactionPool.get().beginWork();
      try {
        PreparedStatement ps = writeTransaction.prepareStatement(query, null);
       
        final String name = object.get("name");
        final int id = object.getInt("#db_id");
        System.out.println(id + " " + name);
        for (final RPSlot slot : object.slots()) {
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ISQLConnection.prepareStatement()

      if (s_log.isDebugEnabled())
      {
        s_log.debug("Getting triggers for table " + tableName + " in schema " + schemaName
              + " and catalog " + catalogName + " - Running query: " + query);
      }
      pstmt = conn.prepareStatement(query);
      triggerExtractor.bindParamters(pstmt, tableInfo);
      rs = pstmt.executeQuery();
      while (rs.next())
      {
        DatabaseObjectInfo doi = new DatabaseObjectInfo(
View Full Code Here

Examples of org.apache.derby.iapi.jdbc.EngineConnection.prepareStatement()

  {
        EngineConnection conn = database.getConnection();
        if (withHoldCursor == -1) {
            // Holdability not explictly set, let the
            // connection provide the default.
            return conn.prepareStatement(sqlStmt,
                    scrollType, concurType);
        }
       
        // Holdability explictly set.
        return conn.prepareStatement(sqlStmt,
View Full Code Here

Examples of org.apache.hadoop.hbase.hbql.client.HConnection.prepareStatement()

                     + "family1 ("
                     + "  val1 INT ALIAS val1, "
                     + "  val2 STRING ALIAS val2 DEFAULT 'this is a default value'"
                     + "))");

        HPreparedStatement ps = conn.prepareStatement("INSERT INTO fooMapping (keyval, val1, val2) "
                                                      + "VALUES (:key, :val1, DEFAULT)");

        ps.setParameter("key", Util.getZeroPaddedNonNegativeNumber(2, 10));
        ps.setParameter("val1", 123);
View Full Code Here

Examples of org.apache.jena.jdbc.connections.JenaConnection.prepareStatement()

     * @throws SQLException
     */
    @Test
    public void prepared_statement_setters_73() throws SQLException {
        JenaConnection conn = this.getConnection();
        JenaPreparedStatement stmt = (JenaPreparedStatement) conn.prepareStatement("SELECT * WHERE { ?s ?p ? }");

        stmt.setObject(1, 123.4f, Types.JAVA_OBJECT);
        ParameterizedSparqlString pss = stmt.getParameterizedString();
        Assert.assertTrue(pss.toString().contains("123.4"));
        Assert.assertTrue(pss.toString().contains(XSDDatatype.XSDfloat.getURI()));
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.