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