Examples of createStatement()


Examples of java.sql.Connection.createStatement()

        IOUtils.deleteRecursive(TEMP_DIR, true);
    }

    private void testFunctionTable() throws SQLException {
        Connection conn = getConnection("functions");
        Statement stat = conn.createStatement();
        stat.execute("create alias simple_function_table for \"" + TestFunctions.class.getName() + ".simpleFunctionTable\"");
        stat.execute("select * from simple_function_table() where a>0 and b in ('x', 'y')");
        conn.close();
    }

View Full Code Here

Examples of java.sql.Connection.createStatement()

        return result;
    }

    private void testNvl2() throws SQLException {
        Connection conn = getConnection("functions");
        Statement stat = conn.createStatement();

        String createSQL = "CREATE TABLE testNvl2(id BIGINT, txt1 varchar, txt2 varchar, num number(9, 0));";
        stat.execute(createSQL);
        stat.execute("insert into testNvl2(id, txt1, txt2, num) values(1, 'test1', 'test2', null)");
        stat.execute("insert into testNvl2(id, txt1, txt2, num) values(2, null, 'test4', null)");
View Full Code Here

Examples of java.sql.Connection.createStatement()

        conn.close();
    }

    private void testValue() throws SQLException {
        Connection conn = getConnection("functions");
        Statement stat = conn.createStatement();
        ResultSet rs;
        stat.execute("create alias TO_CHAR for \"" + getClass().getName() + ".toChar\"");
        rs = stat.executeQuery("call TO_CHAR(TIMESTAMP '2001-02-03 04:05:06', 'format')");
        rs.next();
        assertEquals("2001-02-03 04:05:06.0", rs.getString(1));
View Full Code Here

Examples of java.sql.Connection.createStatement()

        return args[0].convertTo(Value.STRING);
    }

    private void testDefaultConnection() throws SQLException {
        Connection conn = getConnection("functions;DEFAULT_CONNECTION=TRUE");
        Statement stat = conn.createStatement();
        stat.execute("create alias test for \""+TestFunctions.class.getName()+".testDefaultConn\"");
        stat.execute("call test()");
        stat.execute("drop alias test");
        conn.close();
    }
View Full Code Here

Examples of java.sql.Connection.createStatement()

        DriverManager.getConnection("jdbc:default:connection");
    }

    private void testFunctionInSchema() throws SQLException {
        Connection conn = getConnection("functions");
        Statement stat = conn.createStatement();

        stat.execute("create schema schema2");
        stat.execute("create alias schema2.func as 'int x() { return 1; }'");
        stat.execute("create view test as select schema2.func()");
        ResultSet rs;
View Full Code Here

Examples of java.sql.Connection.createStatement()

        conn.close();
    }

    private void testGreatest() throws SQLException {
        Connection conn = getConnection("functions");
        Statement stat = conn.createStatement();

        String createSQL = "CREATE TABLE testGreatest (id BIGINT);";
        stat.execute(createSQL);
        stat.execute("insert into testGreatest values (1)");
View Full Code Here

Examples of l2p.database.ThreadConnection.createStatement()

    ThreadConnection con = null;
    FiltredStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.createStatement();
      statement.executeUpdate("UPDATE epic_boss_spawn SET respawnDate=" + _respawnDate / 1000 + ", state=" + _state.ordinal() + " WHERE bossId=" + _bossId);
      _log.info("update EpicBossState: ID:" + _bossId + ", RespawnDate:" + _respawnDate / 1000 + ", State:" + _state.toString());
    }
    catch(Exception e)
    {
View Full Code Here

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

    @Override
    public void execute(Database database) throws CustomChangeException {
        JdbcConnection conn = (JdbcConnection) database.getConnection();
        try {
            Statement stmt =
                    conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
                            ResultSet.CONCUR_UPDATABLE);
            try {
                Map<Long, String> docToLocaleMap = new HashMap<Long, String>();
                String docLocaleSql =
                        "select doc.id, loc.localeId from HDocument doc, HLocale loc where doc.locale = loc.id";
View Full Code Here

Examples of net.hydromatic.optiq.jdbc.OptiqConnection.createStatement()

      Connection connection =
          DriverManager.getConnection("jdbc:optiq:");
      OptiqConnection optiqConnection =
          connection.unwrap(OptiqConnection.class);
      final OptiqServerStatement statement =
          optiqConnection.createStatement().unwrap(OptiqServerStatement.class);
      //noinspection deprecation
      return new OptiqPrepareImpl().perform(statement, action);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
View Full Code Here

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

  protected IDataSet createDataSet() throws DataSetException
  {
    final ISQLConnection conn = getSession().getSQLConnection();
    try
    {
      final Statement stmt = conn.createStatement();
      try
      {
        final ResultSet rs = stmt.executeQuery("select count(*) from "
                        + getTableInfo().getQualifiedName());
        try
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.