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