本文整理汇总了Java中org.opencloudb.net.mysql.RowDataPacket.write方法的典型用法代码示例。如果您正苦于以下问题:Java RowDataPacket.write方法的具体用法?Java RowDataPacket.write怎么用?Java RowDataPacket.write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opencloudb.net.mysql.RowDataPacket
的用法示例。
在下文中一共展示了RowDataPacket.write方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: response
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
public static void response(ServerConnection c) {
if (MycatServer.getInstance().isOnline()) {
ByteBuffer buffer = c.allocate();
buffer = header.write(buffer, c,true);
for (FieldPacket field : fields) {
buffer = field.write(buffer, c,true);
}
buffer = eof.write(buffer, c,true);
byte packetId = eof.packetId;
RowDataPacket row = new RowDataPacket(FIELD_COUNT);
row.add(getUser(c));
row.packetId = ++packetId;
buffer = row.write(buffer, c,true);
EOFPacket lastEof = new EOFPacket();
lastEof.packetId = ++packetId;
buffer = lastEof.write(buffer, c,true);
c.write(buffer);
} else {
error.write(c);
}
}
示例2: execute
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
public static void execute(ManagerConnection c) {
ByteBuffer buffer = c.allocate();
buffer = header.write(buffer, c, true);
for (FieldPacket field : fields) {
buffer = field.write(buffer, c, true);
}
buffer = eof.write(buffer, c, true);
byte packetId = eof.packetId;
String charset = c.getCharset();
for (NIOProcessor p : MycatServer.getInstance().getProcessors()) {
for (BackendConnection bc : p.getBackends().values()) {
if (bc != null) {
RowDataPacket row = getRow(bc, charset);
row.packetId = ++packetId;
buffer = row.write(buffer, c, true);
}
}
}
EOFPacket lastEof = new EOFPacket();
lastEof.packetId = ++packetId;
buffer = lastEof.write(buffer, c, true);
c.write(buffer);
}
示例3: response
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
public static void response(ServerConnection c) {
ByteBuffer buffer = c.allocate();
buffer = header.write(buffer, c,true);
for (FieldPacket field : fields) {
buffer = field.write(buffer, c,true);
}
buffer = eof.write(buffer, c,true);
byte packetId = eof.packetId;
RowDataPacket row = new RowDataPacket(FIELD_COUNT);
row.add(StringUtil.encode("REPEATABLE-READ",c.getCharset()));
row.packetId = ++packetId;
buffer = row.write(buffer, c,true);
EOFPacket lastEof = new EOFPacket();
lastEof.packetId = ++packetId;
buffer = lastEof.write(buffer, c,true);
c.write(buffer);
}
示例4: response
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
public static void response(ServerConnection c) {
ByteBuffer buffer = c.allocate();
buffer = header.write(buffer, c);
for (FieldPacket field : fields) {
buffer = field.write(buffer, c);
}
buffer = eof.write(buffer, c);
byte packetId = eof.packetId;
RowDataPacket row = new RowDataPacket(FIELD_COUNT);
row.add(StringUtil.encode("REPEATABLE-READ",c.getCharset()));
row.packetId = ++packetId;
buffer = row.write(buffer, c);
EOFPacket lastEof = new EOFPacket();
lastEof.packetId = ++packetId;
buffer = lastEof.write(buffer, c);
c.write(buffer);
}
示例5: response
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
public static void response(ServerConnection c) {
ByteBuffer buffer = c.allocate();
buffer = header.write(buffer, c);
for (FieldPacket field : fields) {
buffer = field.write(buffer, c);
}
buffer = eof.write(buffer, c);
byte packetId = eof.packetId;
RowDataPacket row = new RowDataPacket(FIELD_COUNT);
row.add(LongUtil.toBytes(1));
row.packetId = ++packetId;
buffer = row.write(buffer, c);
EOFPacket lastEof = new EOFPacket();
lastEof.packetId = ++packetId;
buffer = lastEof.write(buffer, c);
c.write(buffer);
}
示例6: execute
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
public static void execute(ManagerConnection c) {
ByteBuffer buffer = c.allocate();
// write header
buffer = header.write(buffer, c,true);
// write fields
for (FieldPacket field : fields) {
buffer = field.write(buffer, c,true);
}
// write eof
buffer = eof.write(buffer, c,true);
// write rows
byte packetId = eof.packetId;
RowDataPacket row = new RowDataPacket(FIELD_COUNT);
row.add(VERSION_COMMENT);
row.packetId = ++packetId;
buffer = row.write(buffer, c,true);
// write last eof
EOFPacket lastEof = new EOFPacket();
lastEof.packetId = ++packetId;
buffer = lastEof.write(buffer, c,true);
// post write
c.write(buffer);
}
示例7: execute
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
public static void execute(ManagerConnection c) {
ByteBuffer buffer = c.allocate();
// write header
buffer = header.write(buffer, c,true);
// write fields
for (FieldPacket field : fields) {
buffer = field.write(buffer, c,true);
}
// write eof
buffer = eof.write(buffer, c,true);
// write rows
byte packetId = eof.packetId;
List<NameableExecutor> executors = getExecutors();
for (NameableExecutor exec : executors) {
if (exec != null) {
RowDataPacket row = getRow(exec, c.getCharset());
row.packetId = ++packetId;
buffer = row.write(buffer, c,true);
}
}
// write last eof
EOFPacket lastEof = new EOFPacket();
lastEof.packetId = ++packetId;
buffer = lastEof.write(buffer, c,true);
// write buffer
c.write(buffer);
}
示例8: execute
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
public static void execute(ManagerConnection c) {
ByteBuffer buffer = c.allocate();
// write header
buffer = header.write(buffer, c,true);
// write fields
for (FieldPacket field : fields) {
buffer = field.write(buffer, c,true);
}
// write eof
buffer = eof.write(buffer, c,true);
// write rows
byte packetId = eof.packetId;
String charset = c.getCharset();
for (NIOProcessor p : MycatServer.getInstance().getProcessors()) {
for (FrontendConnection fc : p.getFrontends().values()) {
if (!fc.isClosed()) {
RowDataPacket row = getRow(fc, charset);
row.packetId = ++packetId;
buffer = row.write(buffer, c,true);
}
}
}
// write last eof
EOFPacket lastEof = new EOFPacket();
lastEof.packetId = ++packetId;
buffer = lastEof.write(buffer, c,true);
// write buffer
c.write(buffer);
}
示例9: response
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
public static void response(SampleConnection c, String message) {
byte packetId = 0;
ByteBuffer buffer = c.allocate();
// header
ResultSetHeaderPacket header = new ResultSetHeaderPacket();
header.packetId = ++packetId;
header.fieldCount = 1;
buffer = header.write(buffer, c);
// fields
FieldPacket[] fields = new FieldPacket[header.fieldCount];
for (FieldPacket field : fields) {
field = new FieldPacket();
field.packetId = ++packetId;
field.charsetIndex = CharsetUtil.getIndex("Cp1252");
field.name = "SampleServer".getBytes();
field.type = Fields.FIELD_TYPE_VAR_STRING;
buffer = field.write(buffer, c);
}
// eof
EOFPacket eof = new EOFPacket();
eof.packetId = ++packetId;
buffer = eof.write(buffer, c);
// rows
RowDataPacket row = new RowDataPacket(header.fieldCount);
row.add(message != null ? encode(message, c.getCharset()) : encode("HelloWorld!", c.getCharset()));
row.packetId = ++packetId;
buffer = row.write(buffer, c);
// write lastEof
EOFPacket lastEof = new EOFPacket();
lastEof.packetId = ++packetId;
buffer = lastEof.write(buffer, c);
// write buffer
c.write(buffer);
}
示例10: execute
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
public static void execute(ManagerConnection c, long sql) {
ByteBuffer buffer = c.allocate();
// write header
buffer = header.write(buffer, c,true);
// write fields
for (FieldPacket field : fields) {
buffer = field.write(buffer, c,true);
}
// write eof
buffer = eof.write(buffer, c,true);
// write rows
byte packetId = eof.packetId;
for (int i = 0; i < 3; i++) {
RowDataPacket row = getRow(sql, c.getCharset());
row.packetId = ++packetId;
buffer = row.write(buffer, c,true);
}
// write last eof
EOFPacket lastEof = new EOFPacket();
lastEof.packetId = ++packetId;
buffer = lastEof.write(buffer, c,true);
// write buffer
c.write(buffer);
}
示例11: execute
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
public static void execute(ManagerConnection c) {
ByteBuffer buffer = c.allocate();
// write header
buffer = header.write(buffer, c);
// write fields
for (FieldPacket field : fields) {
buffer = field.write(buffer, c);
}
// write eof
buffer = eof.write(buffer, c);
// write rows
byte packetId = eof.packetId;
RowDataPacket row = new RowDataPacket(FIELD_COUNT);
row.add(VERSION_COMMENT);
row.packetId = ++packetId;
buffer = row.write(buffer, c);
// write last eof
EOFPacket lastEof = new EOFPacket();
lastEof.packetId = ++packetId;
buffer = lastEof.write(buffer, c);
// post write
c.write(buffer);
}
示例12: showInfo
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
private static PackageBufINf showInfo(ManagerConnection c,
ByteBuffer buffer, byte packetId, String string) {
PackageBufINf bufINf = new PackageBufINf();
RowDataPacket row = new RowDataPacket(FIELD_COUNT);
row.add(StringUtil.encode(string, c.getCharset()));
row.packetId = ++packetId;
buffer = row.write(buffer, c,true);
bufINf.packetId = packetId;
bufINf.buffer = buffer;
return bufINf;
}
示例13: execute
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
public static void execute(ManagerConnection c) {
ByteBuffer buffer = c.allocate();
// write header
buffer = header.write(buffer, c,true);
// write fields
for (FieldPacket field : fields) {
buffer = field.write(buffer, c,true);
}
// write eof
buffer = eof.write(buffer, c,true);
// write rows
byte packetId = eof.packetId;
RowDataPacket row = getRow(c.getCharset());
row.packetId = ++packetId;
buffer = row.write(buffer, c,true);
// write last eof
EOFPacket lastEof = new EOFPacket();
lastEof.packetId = ++packetId;
buffer = lastEof.write(buffer, c,true);
// write buffer
c.write(buffer);
}
示例14: execute
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
public static void execute(ManagerConnection c) {
ByteBuffer buffer = c.allocate();
// write header
buffer = header.write(buffer, c,true);
// write fields
for (FieldPacket field : fields) {
buffer = field.write(buffer, c,true);
}
// write eof
buffer = eof.write(buffer, c,true);
// write rows
byte packetId = eof.packetId;
RowDataPacket row = getRow(c.getCharset());
row.packetId = ++packetId;
buffer = row.write(buffer, c,true);
// write lastEof
EOFPacket lastEof = new EOFPacket();
lastEof.packetId = ++packetId;
buffer = lastEof.write(buffer, c,true);
// write buffer
c.write(buffer);
}
示例15: response
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
public static void response(ServerConnection c, String stmt, int aliasIndex, final String orgName) {
String alias = ParseUtil.parseAlias(stmt, aliasIndex);
if (alias == null) {
alias = orgName;
}
ByteBuffer buffer = c.allocate();
// write header
buffer = header.write(buffer, c);
// write fields
byte packetId = header.packetId;
FieldPacket field = PacketUtil.getField(alias, orgName, Fields.FIELD_TYPE_LONGLONG);
field.packetId = ++packetId;
buffer = field.write(buffer, c);
// write eof
EOFPacket eof = new EOFPacket();
eof.packetId = ++packetId;
buffer = eof.write(buffer, c);
// write rows
RowDataPacket row = new RowDataPacket(FIELD_COUNT);
row.add(LongUtil.toBytes(c.getLastInsertId()));
row.packetId = ++packetId;
buffer = row.write(buffer, c);
// write last eof
EOFPacket lastEof = new EOFPacket();
lastEof.packetId = ++packetId;
buffer = lastEof.write(buffer, c);
// post write
c.write(buffer);
}