eclipse-JDBC连接oracle数据库

1.下载jdbc oracle的jar包ojdbc6.jar

2.请记住自己数据库用户的用户名,密码,端口号,服务名(在图中查询)

eclipse-JDBC连接oracle数据库
3.URL:  jdbc:oracle:thin:@localhost:图中端口号:图中服务名    USERNAME:图中用户名            PASSWORD:图中口令
4.Class.forName("oracle.jdbc.OracleDriver");
Connection connection = DriverManager.getConnection(URL,USERNAME,PASSWORD);
Statement stmt = connection.createStatement();
//进行操作↓

String querySql = "sql语句";

int count = stmt.executeUpdate(querySql);

system.out.println("输出受影响的行数"+count);