package com.zxx.util;
import org.apache.commons.dbutils.DbUtils;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException; public class DBUtil {
private static String url="jdbc:oracle:thin:@127.0.0.1:1521:orcl";
private static String user = "scott";
private static String password = "tiger"; static {
DbUtils.loadDriver("com.mysql.cj.jdbc.Driver");
} public static Connection getConn(){
try {
return DriverManager.getConnection(url,user,password);
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
} 需要导的jar包

												

最新文章

  1. ajax post提交form表单 报400错误 解决方法
  2. 安卓使用adb命令安装软件
  3. Java程序设计 实验二 Java面向对象程序设计
  4. Rotate Image [LeetCode]
  5. android_Activity之Button_OnClickListener
  6. SAP的吐槽来源
  7. TypeScript的崛起
  8. systemstate dump 介绍
  9. javascript js 内存泄露工具使用
  10. OC5_构造方法与self指针
  11. 「C」 函数、运算、流程控制
  12. Kindle PaperWhite3 越狱和PDF插件的安装
  13. c# winform打印excel(使用NPOI+Spire.xls+PrintDocument直接打印excel)
  14. 【Linux】CentOs的常用命令
  15. python itchat+机器人web api实现个人微信机器人
  16. JustOj 1994: P1001
  17. SpringMVC学习四(@ModelMap @RequestBody等等的说明)
  18. effective c++ 笔记 (45-48)
  19. Windows自动执行java脚本
  20. ppt正文排版

热门文章

  1. ubuntu安装chrome driver
  2. 下载eclipse 配置eclipse 新建Java项目 写一个小程序 运行
  3. 转:JMeter5的If Controller操作解析
  4. Shichikuji and Power Grid
  5. [CTS2019]珍珠——二项式反演
  6. ARTS打卡计划第十一周
  7. C#_选择结构,Console的应用,数据类型转换
  8. DDCTF-2019-writeup(7web+5misc)
  9. Python中二维数组的创建
  10. Qt子窗口QMidSubwindow全屏出现的问题总结