Examples of createStatement()


Examples of oracle.jdbc.OracleConnection.createStatement()

        //ResultSet rset_src = null;
        try {
            if (conn.isClosed()) {
                new SQLException("Connection is closed.");
            }
            stmt = conn.createStatement();
            switch (SelObjectAccessed) {
                case User:
                    rset = stmt.executeQuery("select t.object_name, t.created, t.last_ddl_time, t.status, '' from user_objects t where t.object_type = '" + AllObjType.toString().replace('_', ' ') + "'");
                    break;
                case All:
View Full Code Here

Examples of oracle.jdbc.driver.OracleConnection.createStatement()

                        }
                    }
                });
                // Register each table for database events, this is done by executing a select from the table.
                for (DatabaseTable table : this.descriptorsByTable.keySet()) {
                    OracleStatement statement = (OracleStatement)connection.createStatement();
                    statement.setDatabaseChangeRegistration(this.register);               
                    try {
                        statement.executeQuery("SELECT ROWID FROM " + table.getQualifiedName()).close();
                        databaseSession.log(SessionLog.FINEST, SessionLog.CONNECTION, "dcn_register_table", table.getQualifiedName());
                    } catch (Exception failed) {
View Full Code Here

Examples of org.apache.cayenne.access.QueryTranslator.createStatement()

    public void performAction(Connection connection, OperationObserver observer)
            throws SQLException, Exception {

        QueryTranslator translator = createTranslator(connection);

        PreparedStatement statement = translator.createStatement();

        try {
            // execute update
            int count = statement.executeUpdate();
            QueryLogger.logUpdateCount(count);
View Full Code Here

Examples of org.apache.cayenne.access.trans.ProcedureTranslator.createStatement()

        transl.setAdapter(getAdapter());
        transl.setQuery(query);
        transl.setEntityResolver(this.getEntityResolver());
        transl.setConnection(connection);

        CallableStatement statement = (CallableStatement) transl.createStatement();

        try {
            // stored procedure may contain a mixture of update counts and result sets,
            // and out parameters. Read out parameters first, then
            // iterate until we exhaust all results
View Full Code Here

Examples of org.apache.cayenne.access.trans.QueryAssembler.createStatement()

    public void performAction(Connection connection, OperationObserver observer)
            throws SQLException, Exception {

        QueryAssembler translator = createTranslator(connection);

        PreparedStatement statement = translator.createStatement();

        try {
            // execute update
            int count = statement.executeUpdate();
            QueryLogger.logUpdateCount(count);
View Full Code Here

Examples of org.apache.cayenne.access.trans.SelectTranslator.createStatement()

            throws SQLException, Exception {

        long t1 = System.currentTimeMillis();

        SelectTranslator translator = createTranslator(connection);
        PreparedStatement prepStmt = translator.createStatement();
        ResultSet rs = prepStmt.executeQuery();

        RowDescriptor descriptor = new RowDescriptorBuilder().setColumns(
                translator.getResultColumns()).getDescriptor(
                getAdapter().getExtendedTypes());
View Full Code Here

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

                              + "TIME RANGE NOW()-DAY(25) TO NOW()+DAY(1) "
                              + "VERSIONS 3 "
                              //+ "SERVER FILTER WHERE author LIKE '.*val.*' OR LENGTH(author) > 4 "
                              + "CLIENT FILTER WHERE author LIKE '.*val.*' OR LENGTH(author) > 4";

        HStatement stmt = conn.createStatement();
        HResultSet<TestObject> results2 = stmt.executeQuery(query2, TestObject.class);

        for (TestObject val2 : results2) {
            System.out.println("Current Values: " + val2.keyval + " - " + val2.author + " - " + val2.title);

View Full Code Here

Examples of org.apache.hive.jdbc.HiveConnection.createStatement()

  public void testHookContexts() throws Throwable {
    Properties connProp = new Properties();
    connProp.setProperty("user", System.getProperty("user.name"));
    connProp.setProperty("password", "");
    HiveConnection connection = new HiveConnection("jdbc:hive2://localhost:10000/default", connProp);
    Statement stmt = connection.createStatement();
    stmt.executeQuery("show databases");
    stmt.executeQuery("show tables");
    Throwable error = PostExecHook.error;
    if (error != null) {
      throw error;
View Full Code Here

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

     * @throws SQLException
     */
    @Test(expected = SQLFeatureNotSupportedException.class)
    public void statement_bad_wrapper_01() throws SQLException {
        JenaConnection conn = this.getConnection();
        Statement stmt = conn.createStatement();

        try {
            stmt.isWrapperFor(JenaStatement.class);
        } finally {
            stmt.close();
View Full Code Here

Examples of org.apache.phoenix.jdbc.PhoenixConnection.createStatement()

                Properties scnProps = PropertiesUtil.deepCopy(props);
                scnProps.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP));
                scnProps.remove(PhoenixRuntime.TENANT_ID_ATTRIB);
                metaConnection = new PhoenixConnection(this, url, scnProps, newEmptyMetaData());
                try {
                    metaConnection.createStatement().executeUpdate(QueryConstants.CREATE_TABLE_METADATA);
                } catch (TableAlreadyExistsException ignore) {
                    // Ignore, as this will happen if the SYSTEM.TABLE already exists at this fixed timestamp.
                    // A TableAlreadyExistsException is not thrown, since the table only exists *after* this fixed timestamp.
                }
                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.