Examples of createStatement()


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

    Connection con;
    try {
      con = JDBCConnection.getConexion();
      String sqlStm = "update cuenta set saldo = " + cta.getSaldo()
          + " where idCuenta = " + cta.getIdCuenta();
      java.sql.Statement sqlSta = con.createStatement();
      sqlSta.executeUpdate(sqlStm);

      // si la cuenta tiene movimientos nuevos los ingresa tambien a la
      // base de datos
View Full Code Here

Examples of com.mysql.jdbc.ReplicationConnection.createStatement()

            .getConnectionCountWithHostAsSlave(replicationGroup1,
                secondHost));
   
    ReplicationConnectionGroupManager.removeMasterHost(replicationGroup1, firstHost);

    conn2.createStatement().execute("SELECT 1");
    assertFalse(conn2.isClosed());

    conn2.commit();

    // validate that queries are successful:
View Full Code Here

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

        props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(timestamp));
        // Cannot go through DriverManager or you end up in an infinite loop because it'll call init again
        PhoenixConnection metaConnection = new PhoenixConnection(this, oldMetaConnection.getURL(), props, oldMetaConnection.getPMetaData());
        SQLException sqlE = null;
        try {
            metaConnection.createStatement().executeUpdate("ALTER TABLE " + PhoenixDatabaseMetaData.TYPE_SCHEMA_AND_TABLE + " ADD IF NOT EXISTS " + columns );
        } catch (SQLException e) {
            sqlE = e;
        } finally {
            try {
                oldMetaConnection.close();
View Full Code Here

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

        final String col_name2 = "id2";
       
        try
        {
            connection = isolConnection.getIsolatedConnection (user, password);
            statement = connection.createStatement ();
            statement.executeUpdate ("drop table if exists " + tbl_name1);
            statement.executeUpdate ("drop table if exists " + tbl_name2);
            statement.executeUpdate ("create table " + tbl_name1 + " (" +
            col_name1 + " int)");
            statement.executeUpdate ("create table " + tbl_name2 + " (" +
View Full Code Here

Examples of de.mhus.lib.sql.DbConnection.createStatement()

      System.out.println("----------------------");
     
      // test a native sql execute - remove all persons
     
      DbConnection con = manager.getPool().getConnection();
      con.createStatement("DELETE FROM $db.Person$", null ).execute(manager.getNameMapping());
      con.commit();
     
      System.out.println("----------------------");
      col = manager.executeQuery(new Person(), "select * from $db.Person$"null);
      count = 0;
View Full Code Here

Examples of java.sql.Connection.createStatement()

   {
      DataSource ds = (DataSource)new InitialContext().lookup(datasource);
      Connection conn = ds.getConnection();
      boolean load = false;

      Statement st = conn.createStatement();
      ResultSet rs = null;
      try
      {
         rs = st.executeQuery(existsSql.trim());
         rs.close();
View Full Code Here

Examples of java.sql.Connection.createStatement()

        jdbc_conn = DriverManager.getConnection(JDBCurl, DbUser, DbPass);
         
        logger.debug( "JDBC Connection OK: " + jdbc_conn.toString());
         
        // get the PL/SQL and corresponding LOG4J log levels
        statement = jdbc_conn.createStatement();
        rs = statement.executeQuery(SQLQuery);
           
        if (rs != null)
        {
          while(rs.next())
View Full Code Here

Examples of java.sql.Connection.createStatement()

        deleteDb("memoryUsage");
        conn = getConnection("memoryUsage");
        eatMemory(4000);
        for (int i = 0; i < 40000; i++) {
            Connection c2 = getConnection("memoryUsage");
            c2.createStatement();
            c2.close();
        }
        freeMemory();
        conn.close();
    }
View Full Code Here

Examples of java.sql.Connection.createStatement()

            return;
        }
        FileSystem.getInstance("split:").delete("split:" + getBaseDir() + "/openClose2.h2.db");
        Connection conn;
        conn = DriverManager.getConnection("jdbc:h2:split:18:" + getBaseDir() + "/openClose2");
        conn.createStatement().execute("create table test(id int, name varchar) as select 1, space(1000000)");
        conn.close();
        FileObject f = FileSystem.getInstance(getBaseDir()).openFileObject(getBaseDir() + "/openClose2.h2.db.1.part", "rw");
        f.setFileLength(f.length() * 2);
        f.close();
        assertThrows(ErrorCode.IO_EXCEPTION_2, this).
View Full Code Here

Examples of java.sql.Connection.createStatement()

        for (int i = 0; System.currentTimeMillis() - time < 100; i++) {
            conn = DriverManager.getConnection(url, user, password);
            conn.close();
        }
        conn = DriverManager.getConnection(url, user, password);
        conn.createStatement().execute("SHUTDOWN");
        conn.close();
    }

    private void testBackup() throws SQLException {
        if (config.memory) {
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.