ORACLE jdbc

		Class.forName( "oracle.jdbc.driver.OracleDriver" ); 
		Connection cn = DriverManager.getConnection( "jdbc:oracle:thin:@yourIp:1521:ORCL", "用户名", "密码" ); 
		Statement stat = cn.createStatement();
		ResultSet rs = stat.executeQuery("select 2 from dual");
		while(rs.next()){
			System.out.println(rs.getInt(1));
		}

 

你可能感兴趣的:(oracle)