当前位置: 首页>>代码示例>>Java>>正文


Java Buffer类代码示例

本文整理汇总了Java中com.mysql.jdbc.Buffer的典型用法代码示例。如果您正苦于以下问题:Java Buffer类的具体用法?Java Buffer怎么用?Java Buffer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Buffer类属于com.mysql.jdbc包,在下文中一共展示了Buffer类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execSQL

import com.mysql.jdbc.Buffer; //导入依赖的package包/类
public ResultSetInternalMethods execSQL(StatementImpl callingStatement,
										String sql, int maxRows, Buffer packet, int resultSetType,
										int resultSetConcurrency, boolean streamResults, String catalog,
										Field[] cachedMetadata) throws SQLException {
	return getActiveMySQLConnection().execSQL(callingStatement, sql, maxRows, packet, resultSetType,
										 resultSetConcurrency, streamResults, catalog, cachedMetadata);
}
 
开发者ID:hinsenchan,项目名称:fil_project_mgmt_app_v2,代码行数:8,代码来源:FabricMySQLConnectionProxy.java

示例2: nextAuthenticationStep

import com.mysql.jdbc.Buffer; //导入依赖的package包/类
public boolean nextAuthenticationStep(Buffer fromServer, List<Buffer> toServer) throws SQLException {
    toServer.clear();
    Buffer bresp = new Buffer(StringUtils.getBytes(this.password));
    toServer.add(bresp);
    return true;
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:7,代码来源:ConnectionRegressionTest.java

示例3: execSQL

import com.mysql.jdbc.Buffer; //导入依赖的package包/类
public ResultSetInternalMethods execSQL(StatementImpl callingStatement, String sql, int maxRows, Buffer packet, int resultSetType, int resultSetConcurrency,
        boolean streamResults, String catalog, Field[] cachedMetadata) throws SQLException {
    return getActiveMySQLConnectionChecked().execSQL(callingStatement, sql, maxRows, packet, resultSetType, resultSetConcurrency, streamResults, catalog,
            cachedMetadata);
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:6,代码来源:FabricMySQLConnectionProxy.java

示例4: extractSqlFromPacket

import com.mysql.jdbc.Buffer; //导入依赖的package包/类
public String extractSqlFromPacket(String possibleSqlQuery, Buffer queryPacket, int endOfQueryPacketPosition) throws SQLException {
    return getActiveMySQLConnectionChecked().extractSqlFromPacket(possibleSqlQuery, queryPacket, endOfQueryPacketPosition);
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:4,代码来源:FabricMySQLConnectionProxy.java

示例5: nextAuthenticationStep

import com.mysql.jdbc.Buffer; //导入依赖的package包/类
@Override
public boolean nextAuthenticationStep(final Buffer fromServer, final List<Buffer> toServer) throws SQLException {
    try {
        toServer.clear();

        if (fromServer == null) {
            throw SQLError.createSQLException("Unexpected empty challenge ", SQLError.SQL_STATE_GENERAL_ERROR, null);
        }

        if (firstChallenge) {
            firstChallenge = false;
            toServer.add(new Buffer(new byte[0]));
            return true;
        }

        ByteBuffer byteBuffer = ByteBuffer.wrap(fromServer.getByteBuffer(), 0, fromServer.getBufLength());
        byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
        if (saslClients.isEmpty()) {
            String mechanism = readString(byteBuffer);
            int iterations = byteBuffer.getInt();
            for (int i = 0; i < iterations; i++) {
                saslClients.add(createSaslClient(mechanism));
            }
        }

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        for (SaslClient saslClient : saslClients) {
            byte[] response = saslClient.evaluateChallenge(getNextChallenge(byteBuffer));

            writeByte(baos, (byte) (saslClient.isComplete() ? 1 : 0));
            writeInt(baos, response.length);
            writeBytes(baos, response);
        }

        toServer.add(new Buffer(baos.toByteArray()));

        return true; // The implementation of the authentication handshake requires that this method always returns true
    } catch (SaslException e) {
        throw SQLError.createSQLException("mongosql_auth authentication exception ", SQLError.SQL_STATE_GENERAL_ERROR, e, null);
    }
}
 
开发者ID:mongodb,项目名称:mongosql-auth-java,代码行数:42,代码来源:MongoSqlAuthenticationPlugin.java

示例6: execSQL

import com.mysql.jdbc.Buffer; //导入依赖的package包/类
public ResultSetInternalMethods execSQL(StatementImpl callingStatement, String sql, int maxRows, Buffer packet, int resultSetType, int resultSetConcurrency,
        boolean streamResults, String catalog, Field[] cachedMetadata) throws SQLException {
    return getActiveMySQLConnection().execSQL(callingStatement, sql, maxRows, packet, resultSetType, resultSetConcurrency, streamResults, catalog,
            cachedMetadata);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:FabricMySQLConnectionProxy.java

示例7: extractSqlFromPacket

import com.mysql.jdbc.Buffer; //导入依赖的package包/类
public String extractSqlFromPacket(String possibleSqlQuery, Buffer queryPacket, int endOfQueryPacketPosition) throws SQLException {
    return getActiveMySQLConnection().extractSqlFromPacket(possibleSqlQuery, queryPacket, endOfQueryPacketPosition);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:FabricMySQLConnectionProxy.java

示例8: execSQL

import com.mysql.jdbc.Buffer; //导入依赖的package包/类
public ResultSetInternalMethods execSQL(StatementImpl callingStatement, String sql, int maxRows, Buffer packet, int resultSetType,
        int resultSetConcurrency, boolean streamResults, String catalog, Field[] cachedMetadata) throws SQLException {
    return getActiveMySQLConnection().execSQL(callingStatement, sql, maxRows, packet, resultSetType, resultSetConcurrency, streamResults, catalog,
            cachedMetadata);
}
 
开发者ID:mniepert,项目名称:TPKB,代码行数:6,代码来源:FabricMySQLConnectionProxy.java

示例9: nextAuthenticationStep

import com.mysql.jdbc.Buffer; //导入依赖的package包/类
public boolean nextAuthenticationStep(Buffer fromServer, List<Buffer> toServer) throws SQLException {
    toServer.clear();

    Buffer bresp = new Buffer(StringUtils.getBytes(this.password != null ? this.password : ""));

    bresp.setPosition(bresp.getBufLength());
    int oldBufLength = bresp.getBufLength();

    bresp.writeByte((byte) 0);

    bresp.setBufLength(oldBufLength + 1);
    bresp.setPosition(0);

    toServer.add(bresp);
    return true;
}
 
开发者ID:mniepert,项目名称:TPKB,代码行数:17,代码来源:MysqlClearPasswordPlugin.java

示例10: nextAuthenticationStep

import com.mysql.jdbc.Buffer; //导入依赖的package包/类
public boolean nextAuthenticationStep(Buffer fromServer, List<Buffer> toServer) throws SQLException {
		toServer.clear();
		Buffer bresp = new Buffer(StringUtils.getBytes(this.password));
		toServer.add(bresp);
	return true;
}
 
开发者ID:hinsenchan,项目名称:fil_project_mgmt_app_v2,代码行数:7,代码来源:ConnectionRegressionTest.java


注:本文中的com.mysql.jdbc.Buffer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。