package com.util;
import java.sql.*;
public class JDBCUtil {
public static Connection getconn(){
Connection conn=null;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl", "scott", "orcl");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return conn;
}
public static void close(PreparedStatement ps,Connection conn){
try {
ps.close();
conn.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void close(ResultSet rs,PreparedStatement ps,Connection conn){
try {
rs.close();
ps.close();
conn.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
最近下载更多
ma406805131 LV19
2024年6月18日
asddwh LV13
2024年1月1日
微信网友_6776859393560576 LV1
2023年12月13日
ericxu1116 LV24
2023年6月14日
95959595959 LV13
2023年4月20日
lzl111213 LV1
2023年4月19日
331376387 LV5
2023年1月9日
微信网友_5992582549164032 LV6
2022年12月28日
liangge2115 LV27
2022年12月24日
Tg171017 LV12
2022年12月21日
最近浏览更多
renjunyou LV10
6月2日
liyan54188 LV2
2024年6月25日
19hhhh
2024年6月23日
暂无贡献等级
ma406805131 LV19
2024年6月18日
一起加油 LV5
2024年5月14日
李朝磊 LV18
2024年5月9日
微信网友_6815604991741952 LV1
2024年1月10日
Liang朝伟 LV1
2024年1月5日
沈从文 LV3
2024年1月1日
颜菜菜 LV2
2023年12月30日

