Package WCG. test. JDBC. oracle; import Java. SQL. connection; import Java. SQL. drivermanager; import Java. SQL. resultset; import Java. SQL. sqlexception; import Java. SQL. statement; public class testconnoracle {/*** @ Param ARGs */public static void main (string [] ARGs) throws exception {connection conn = NULL; Class. forname ("oracle. JDBC. driver. oracledriver "); Conn = drivermanager. getconnection ("JDBC: oracle: thin: @ l Ocalhost: 1521: XE "," RMS "," RMS "); statement stmt = Conn. createstatement (); resultset rs = stmt.exe cutequery ("select * From Spark. wcg_users "); While (RS. next () {system. out. println (RS. getint (1); system. out. println (RS. getstring ("username"); system. out. println (RS. getstring ("password"); system. out. println ("----------");} Try {If (RS! = NULL) {Rs. Close (); RS = NULL;} If (stmt! = NULL) {stmt. Close (); stmt = NULL;} If (Conn! = NULL) {conn. Close (); Conn = NULL ;}} catch (sqlexception e) {e. printstacktrace ();}}}