orcl

Class.forName("orcle.jdbc.driver.OracleDriver");
	
		Connection conn=DriverManager.getConnection("jdbc.oracle:thin:@localhost:1521:orcl","scott","tiger");
	
		Statement stmt=conn.createStatement();
		ResultSet rs=stmt.executeQuery("select * from emp");
		while(rs.next()){
			
			System.out.println(rs.getString(1)+rs.getString(2));
		}
		rs.close();
		stmt.close();
		conn.close();

 

你可能感兴趣的:(or)