我正在尝试在 java 中执行查询,但它会引发异常
try {
conn = DriverManager.getConnection(DatabaseURL + DatabaseName, UserName, Password);
System.out.println("1");
Message = "data retrieved successfully ...";
//Statement st = this.conn.createStatement();// Membuat Statement
System.out.println("2");
pr = conn.prepareStatement("SELECT `الكلمة` FROM `name1` WHERE `الموضوع` LIKE 'أداة الطحن' ;");
System.out.println("3");
res = pr.executeQuery();
System.out.println("4");
} catch (Exception e) {
System.out.println("5");
Message = "connection failed \r\n " + e.getMessage();
return null;
}
它打印 1 2 3 5 所以在执行查询时出现问题,所以它不打印 4 我试图在 sql 上运行它,它工作这里有什么问题???