Sets platform information for if the jdbc driver/db combo support
batch operations. Will only be checked once, then have same batch
support setting for the entire session.

@param conn
192146
protected void checkForBatchSupport(Connection conn)
    {
        if (!m_batchUpdatesChecked)
        {
            DatabaseMetaData meta;
            try
            {
                meta = conn.getMetaData();
                m_supportsBatchUpdates = meta.supportsBatchUpdates();
            }
            catch (Throwable th)
            {
                log.info("Batch support check failed", th);
                m_supportsBatchUpdates = false;
            }
            finally
            {
                m_batchUpdatesChecked = true;
            }
        }
    }
385306
public final void setCatalog(String catalog) throws SQLException 
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(this, tc, "Set Catalog to " + catalog); 
        sqlConn.setCatalog(catalog);
        connectionPropertyChanged = true; 
    }
153936
function isInnoDbSupported($conn)
    {
        $results = $conn->query('SHOW ENGINES');

        foreach ($results as $result) {
            if (strtolower($result['Engine']) === 'innodb' && strtolower($result['Support']) !== 'no') {
                return true;
            }
        }

        return false;
    }
273711
public SQLMergeClause addBatch() {
        if (!configuration.getTemplates().isNativeMerge()) {
            throw new IllegalStateException("batch only supported for databases that support native merge");
        }

        batches.add(new SQLMergeBatch(keys, columns, values, subQuery));
        columns.clear();
        values.clear();
        keys.clear();
        subQuery = null;
        return this;
    }
570331
public static int[] executeBatch(Connection conn, String sql, Iterable<Object[]> paramsBatch) throws SQLException {
		PreparedStatement ps = null;
		try {
			ps = StatementUtil.prepareStatementForBatch(conn, sql, paramsBatch);
			return ps.executeBatch();
		} finally {
			DbUtil.close(ps);
		}
	}
861422
public final void closeConnection(final Connection conn) {
        try {
            if (conn != null) {
                conn.close();
            }
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
701303
private void postGetConnectionHandling(Connection conn) throws SQLException {
        helper.doConnectionSetup(conn);

        String[] sqlCommands = dsConfig.get().onConnect;
        if (sqlCommands != null && sqlCommands.length > 0)
            onConnect(conn, sqlCommands);

        // Log the database and driver versions on first getConnection.
        if (!wasUsedToGetAConnection) {
            // Wait until after the connection succeeds to set the indicator.
            // This accounts for the scenario where the first connection attempt is bad.
            // The information needs to be read again on the second attempt.
            helper.gatherAndDisplayMetaDataInfo(conn, this);
            wasUsedToGetAConnection = true;
        }
    }
708504
@Override
    public void setClientInfo(String name, String value) throws SQLClientInfoException {
        internalConn.setClientInfo(name, value);
    }
13838
def execute(self, conn, daoinput, transaction = False):
        	
        if not conn:
	    dbsExceptionHandler("dbsException-failed-connect2host", "Oracle/MigrationRequests/UpdateRequestStatus. Expects db connection from upper layer.", 
                                self.logger.exception)
        if daoinput['migration_status'] == 1:
           sql = self.sql2 
        elif daoinput['migration_status'] == 2:
            sql = self.sql + " and MIGRATION_STATUS = 1 "
        elif daoinput['migration_status'] == 3:
            sql = self.sql3 + " and MIGRATION_STATUS = 1 " 
        else:
            dbsExceptionHandler("dbsException-conflict-data", "Oracle/MigrationRequest/UpdateRequestStatus. Expected migration status to be 1, 2 or 3",
                                self.logger.exception)
        
	result = self.dbi.processData(sql, daoinput, conn, transaction)
860805
public void setPlatforms(java.util.Collection<EnvironmentPlatform> platforms) {
        if (platforms == null) {
            this.platforms = null;
            return;
        }

        this.platforms = new java.util.ArrayList<EnvironmentPlatform>(platforms);
    }
882901
public static void setVCConnectionType(VirtualConnection vc, ConnectionType connType) {
        if (vc == null || connType == null) {
            return;
        }

        Map<Object, Object> map = vc.getStateMap();

        // Internal connections are both inbound and outbound (they're connections
        // to ourselves)
        // so while we prevent setting Outbound ConnTypes for inbound connections
        // and vice versa,
        // we don't prevent internal types from being set as either.
        if (vc instanceof InboundVirtualConnection && ConnectionType.isOutbound(connType.type)) {
            throw new IllegalStateException("Cannot set outbound ConnectionType on inbound VirtualConnection");
        } else if (vc instanceof OutboundVirtualConnection && ConnectionType.isInbound(connType.type)) {
            throw new IllegalStateException("Cannot set inbound ConnectionType on outbound VirtualConnection");
        }

        map.put(CONNECTION_TYPE_VC_KEY, connType);
    }
628534
public void setJdbc(java.util.Collection<CodeGenNodeArg> jdbc) {
        if (jdbc == null) {
            this.jdbc = null;
            return;
        }

        this.jdbc = new java.util.ArrayList<CodeGenNodeArg>(jdbc);
    }
799267
@SuppressWarnings({ "unchecked", "rawtypes" })
    public <T> void set(PreparedStatement stmt, Path<?> path, int i, T value) throws SQLException {
        if (value == null || value instanceof Null) {
            Integer sqlType = null;
            if (path != null) {
                ColumnMetadata columnMetadata = ColumnMetadata.getColumnMetadata(path);
                if (columnMetadata.hasJdbcType()) {
                    sqlType = columnMetadata.getJdbcType();
                }
            }
            if (sqlType != null) {
                stmt.setNull(i, sqlType);
            } else {
                stmt.setNull(i, Types.NULL);
            }
        } else {
            getType(path, (Class) value.getClass()).setValue(stmt, i, value);
        }
    }
1129089
public static boolean startTransaction(Connection conn) throws SQLException {
        if (conn == null) {
            return false;
        }
        String dsName = openConnDsName.get().get(conn);
        OpenConnStats connStats = dsName != null ? openConnStats.get().get(dsName) : null;
        if (connStats != null && !connStats.inTransaction) {
            conn.setAutoCommit(false);
            connStats.inTransaction = true;
            return true;
        }
        return false;
    }
46247
public void localBegin()
    {
        if (this.isInLocalTransaction)
        {
            throw new TransactionInProgressException("Connection is already in transaction");
        }
        Connection connection = null;
        try
        {
            connection = this.getConnection();
        }
        catch (LookupException e)
        {
            /**
             * must throw to notify user that we couldn't start a connection
             */
            throw new PersistenceBrokerException("Can't lookup a connection", e);
        }
        if (log.isDebugEnabled()) log.debug("localBegin was called for con " + connection);
        // change autoCommit state only if we are not in a managed environment
        // and it is enabled by user
        if(!broker.isManaged())
        {
            if (jcd.getUseAutoCommit() == JdbcConnectionDescriptor.AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE)
            {
                if (log.isDebugEnabled()) log.debug("Try to change autoCommit state to 'false'");
                platform.changeAutoCommitState(jcd, connection, false);
            }
        }
        else
        {
            if(log.isDebugEnabled()) log.debug(
                        "Found managed environment setting in PB, will skip Platform.changeAutoCommitState(...) call");
        }
        this.isInLocalTransaction = true;
    }
193423
protected NamedParameterJdbcTemplate namedParameterJdbcTemplate(Connection conn) {
        DataSource ds = new SingleConnectionDataSource(conn, true);
        return new NamedParameterJdbcTemplate(ds);
    }
1213273
public void update(Connection conn, User user) throws SQLException {
        String sql = "UPDATE userbase \n";
        Integer id = user.getId();
        user.setId(null);
        try {
            String s = SQLBuilder.beanToSQLClause(user,",");
            sql = sql + SQLBuilder.getSetClause(s) +"\n"+
                "WHERE id=? ";
        } catch (JibuException e) {
            throw new SQLException(e.getMessage());
        }
        user.setId(id);
        run.update(conn, sql, id);
    }