标签:col ati for rman bundle ring manage pac ora
1.创建一个jdbc.properties 文件
driver=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@127.0.0.1:1521:orcl
username=system
password=123456
2. 创建连接工具
package com.util; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.Enumeration; import java.util.ResourceBundle; public class OracleJdbc { private static String driver; private static String url; private static String username; private static String password; static { ResourceBundle properties = ResourceBundle.getBundle("oracle"); driver = properties.getString("driver"); url = properties.getString("url"); username = properties.getString("username"); password = properties.getString("password"); } public static Connection getConnection() { Connection conn = null; try { Class.forName(driver); conn = DriverManager.getConnection(url,username,password); } catch (Exception e) { e.printStackTrace(); } return conn; } public static void closeConnection(Connection conn) { if(conn!=null){ try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } } }
end
标签:col ati for rman bundle ring manage pac ora
原文地址:https://www.cnblogs.com/zhangzonghua/p/9263862.html