package demo;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
/**
*
* @author Administrator
* @date 2015年12月2日 下午4:52:04
* @description JDBC调用存储过程demo类
*/
public class JdbcDemo1 {
public static void main(String[] args) throws Exception {
System.out.println("---------测试调用存储过程-------");
Connection conn = null;
CallableStatement callStmt = null;
ResultSet rs = null;
String url = "jdbc:mysql://localhost:3306/";
String db = "testdatabase";
String driver = "com.mysql.jdbc.Driver";
String user = "root";
String pass = "root";
try {
Class.forName(driver);
conn = DriverManager.getConnection(url + db, user, pass);
callStmt = conn.prepareCall(&
jdbc调用带select返回结果的DEMO
最新推荐文章于 2022-10-20 23:21:42 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)