欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

连接ORACLE

程序员文章站 2022-03-21 18:01:26
...
package com.cw.test;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBManager {

public DBManager() {
}

/**
* @param args
*/
public static void main(String[] args) {

try {
Class.forName("oracle.jdbc.driver.OracleDriver");
String url = "jdbc:oracle:thin:@10.0.3.220:1521:orcl ";
Connection c = DriverManager.getConnection(url, "ymbi",
"ymbi");
System.out.println("c=="+c);
} catch (Exception e) {
e.printStackTrace();
}

}

}