case 'Q': {
server.trace("Query");
String query = readString();
ScriptReader reader = new ScriptReader(new StringReader(query));
while (true) {
JdbcStatement stat = null;
try {
String s = reader.readStatement();
if (s == null) {
break;
}
s = getSQL(s);
stat = (JdbcStatement) conn.createStatement();
boolean result = stat.execute(s);
if (result) {
ResultSet rs = stat.getResultSet();
ResultSetMetaData meta = rs.getMetaData();
try {
sendRowDescription(meta);
while (rs.next()) {
sendDataRow(rs);
}
sendCommandComplete(stat, 0);
} catch (Exception e) {
sendErrorResponse(e);
break;
}
} else {
sendCommandComplete(stat, stat.getUpdateCount());
}
} catch (SQLException e) {
sendErrorResponse(e);
break;
} finally {