本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}