|
@@ -109,18 +109,15 @@ public class InquiryInfoController {
|
|
|
String username = "root";
|
|
|
// 数据库连接密码
|
|
|
String password = "langtong";
|
|
|
- String driver = "com.mysql.jdbc.Driver";
|
|
|
- // 其中test为数据库名称
|
|
|
+ String driver = "oracle.jdbc.driver.OracleDriver";
|
|
|
+ // orcl
|
|
|
String url="jdbc:oracle:thin:@192.168.3.177:1521:orcl";
|
|
|
// String url = "jdbc:mysql://localhost:3306/sys-icss";
|
|
|
Connection conn = null;
|
|
|
try {
|
|
|
Class.forName(driver);
|
|
|
conn = (Connection) DriverManager.getConnection(url, username, password);
|
|
|
- System.out.println("请输入SQL语句:");
|
|
|
- Scanner input = new Scanner(System.in);
|
|
|
- input.useDelimiter("\n");
|
|
|
- String sql = input.next();
|
|
|
+ String sql = "";
|
|
|
|
|
|
PreparedStatement pst = null;
|
|
|
pst = (PreparedStatement) conn.prepareStatement(sql);
|