📄 setprice.java
字号:
package procedures;
import java.sql.*;
import connections.*;
import java.util.*;
public class SetPrice {
public static void main(String[] args) {
Connection conn = null;
CallableStatement stmt = null;
try {
conn = ConnectionFactory.getConnection();
String sql = "{ call set_price(?, ?) }";
stmt = conn.prepareCall(sql);
stmt.setInt(1, Integer.parseInt(args[0]));
stmt.setDouble(2, Double.parseDouble(args[1]));
stmt.executeUpdate();
// if no exception is thrown, the update succeeded
System.out.println("SetPrice succeeded");
} catch (Exception e) {
System.out.println("SetPrice failed");
e.printStackTrace();
}
finally {
ConnectionFactory.close(stmt);
ConnectionFactory.close(conn);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -