⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setprice.java

📁 此程序都是企业级 的数据库开发程序 全面揭示了JAVA对数据库的操作
💻 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 + -