/*** Separate Java Program Connect to the Oracle database * Author: javaalpha * Date: 12:02:44 */import Java. SQL. *; public class test {public static void main (string [] ARGs) {string driver = "oracle. JDBC. driver. oracledriver "; string url =" JDBC: oracle: thin: @ 192.168.1.1: 1521: orcl "; string user =" root "; string Password =" 123456 "; try {class. forname (driver); connection conn = drivermanager. getconnection (URL, user, password); If (! Conn. isclosed () system. Out. println ("succeeded connecting to the database! "); Statement statement = Conn. createstatement (); string SQL = "select password from user where id = 'test1'"; resultset rs = statement.exe cutequery (SQL); While (RS. next () {system. out. println (RS. getstring ("password");} Rs. close (); Conn. close ();} catch (classnotfoundexception e) {system. out. println ("Sorry, can't find the driver! "); E. printstacktrace ();} catch (sqlexception e) {e. printstacktrace ();} catch (exception e) {e. printstacktrace ();}}}