|
|
@ -144,7 +144,12 @@ public class Main {
|
|
|
|
if (!"--- END ---".equals(line)) {
|
|
|
|
if (!"--- END ---".equals(line)) {
|
|
|
|
commandBuffer.append(line);
|
|
|
|
commandBuffer.append(line);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
System.out.println(mapper.writeValueAsString(SqlExecutor.executeQuery(conn, commandBuffer.toString())));
|
|
|
|
String query = commandBuffer.toString().trim();
|
|
|
|
|
|
|
|
if (query.matches("/^select/i")) {
|
|
|
|
|
|
|
|
System.out.println(mapper.writeValueAsString(SqlExecutor.executeQuery(conn, commandBuffer.toString())));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
System.out.println(mapper.writeValueAsString(SqlExecutor.execute(conn, commandBuffer.toString())));
|
|
|
|
|
|
|
|
}
|
|
|
|
commandBuffer.setLength(0);
|
|
|
|
commandBuffer.setLength(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|