Posts

Showing posts with the label java

Bypassing the Listener and Connecting the Instance without a Password from Java Code

Image
In the past I wrote a post about  Bypassing the listener and connecting to ASM without a password from Python code Now, I've been asked to prove that it can be done in Java. The solution is almost the same. Java sample code using OCI: $ vi OracleCon.java import java.sql.*; class OracleCon {     public static void main(String args[]) {         try {             Class.forName("oracle.jdbc.driver.OracleDriver");             Connection con = DriverManager.getConnection(                 "jdbc:oracle:oci:@(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL=BEQ) (PROGRAM=oracle) (ARGV0=oracle+ASM) (ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))') (ENVS = 'ORACLE_HOME=/oracle/product/12.1.0.2/grid,ORACLE_SID=+ASM'))) (CONNECT_DATA= (SID=+ASM)))", "sys as sysdba", "change on install");             Statement...