diff --git a/src/step5/QueryRecordTest.java b/src/step5/QueryRecordTest.java index 3fe3331..518c27a 100644 --- a/src/step5/QueryRecordTest.java +++ b/src/step5/QueryRecordTest.java @@ -13,9 +13,16 @@ public class QueryRecordTest { public static void main(String[] args) throws SQLException { String tableName = "book"; - + String bookName = ""; Scanner scanner = new Scanner(System.in); - String bookName = scanner.nextLine(); + String input = scanner.nextLine(); + String[] queryInfo = input.split(" "); + if(queryInfo.length != 1) + { + logger.error("参数输入错误"); + return; + } + bookName = queryInfo[0]; QueryRecord queryRecord = new QueryRecord(); String sqlFile=System.getProperty("user.dir")+File.separator+"challenge4.sql"; SQLExec sqlExec = new SQLExec();