C:/oracle/orahome/jdbc/lib/classes12.jar in The Command Prompt
C:/oracle/orahome/jdbc/lib/classes12.jar in The Command Prompt
#ip or ojdbc14.#ip $ithin oracle installation "older 4. Set the classpath to the oracle installation "older %. Set classpath=.;c:\oracle\oraho&e\jdbc\lib\classes12.jar
in the
co&&and pro&pt
'. (river)anager.register(river(ne$ oracle.jdbc.driver.*racle(river( ; +. ,o&pile and run the progra&
-. ,onnection cn=(river)anager.get,onnection(.jdbc:oracle:thin:/sakthi:1%21:orcl0.1.scott.1. tiger. ; 0. 2n the start &enu choose oracle and in con"iguration and &igration tools go to 3et)anager and there look "or hostna&e and portnu&ber and use that in get,onnection ( code.
45:1 progra&
i&port java.io.6; i&port java.s7l.6; class jtable! 8 public static void &ain(String args9: thro$s 2*45ception1S;<45ception 8 (river)anager.register(river(ne$ oracle.jdbc.driver.*racle(river( ; S=ste&.out.println(.connecting to the database.... ; tr=8 ,onnection cn=(river)anager.get,onnection(.jdbc:oracle:thin:/sakthi:1%21:orcl0.1.scott.1.tiger. ; S=ste&.out.println(.connected to the database.... ; State&ent st=cn.createState&ent( ;
st.e5ecute>pdate(.drop table trans. ; S=ste&.out.println(.?able trans dropped. ; @catch(S;<45ception e5 8 S=ste&.out.println(.?he e5ception raised is:.Ae5 ; @ @ @
45:2 progra&
i&port java.io.6; i&port java.s7l.6; class jtable1 8 public static void &ain(String args9: thro$s 2*45ception1S;<45ception 8 (river)anager.register(river(ne$ oracle.jdbc.driver.*racle(river( ; S=ste&.out.println(.connecting to the database.... ; tr= 8 ,onnection cn=(river)anager.get,onnection(.jdbc:oracle:thin:/sakthi:1%21:orcl0.1.scott.1.tiger. ; State&ent st=cn.createState&ent( ; BesultSet rs=st.e5ecute;uer=(.select CconnectedC "ro& dual. ; rs.ne5t( ; String s=rs.getString(1 ; S=ste&.out.println(s ; st.close( ; cn.close( ; @ catch(45ception e5 8 S=ste&.out.println(.?he e5ception raised is:.Ae5 ; @ @ @