encryption - Encrypted Oracle-Ds.xml and decryption in jdbc code -
server :jboss 5.x following function written in session bean(ejb3 architecture)
@remote(oracledsinteractionremote.class) @local(oracledsinteractionlocal.class) @stateless @remotebinding(jndibinding="oracledsinteractionbean/remote") @localbinding(jndibinding="oracledsinteractionbean/local") public class oracledsinteractionbean implements oracledsinteractionremote,oracledsinteractionlocal { @ejb @resource(mappedname="java:/encryptedds") private datasource ds1; public int getallvalues() throws exception { system.out.println("************************* "); connection conn = ds1.getconnection(); statement st = conn.createstatement(); string query = "select count(*) details_data"; resultset rs = st.executequery(query); while (rs.next()) { return rs.getint(1); } return -1; } }
this function retrieving number of rows details_data table using jdbc connection. datasource object ds1 mapped 'encryptedds'. entry of 'encryptedds' defined in oracle-ds.xml following.
<?xml version="1.0" encoding="utf-8"?> <!-- ===================================================================== --> <!-- --> <!-- jboss server configuration --> <datasources> <xa-datasource> <jndi-name>encryptedds</jndi-name> <xa-datasource-class>oracle.jdbc.xa.client.oraclexadatasource</xa-datasource-class> <xa-datasource-property name="url">jdbc:oracle:thin:@182.158.93.26:1521:dbsid</xa-datasource-property> <xa-datasource-property name="user">test</xa-datasource-property> <xa-datasource-property name="password">pass123</xa-datasource-property> <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.oracleexceptionsorter</exception-sorter-class-name> <metadata> <type-mapping>oracle11g</type-mapping> </metadata> </xa-datasource> </datasources>
but problem can go $jboss_home/server/default/deploy directory , find out 'encryptedds' configuration oracle-ds.xml.. (in oracle-ds.xml complete database information written in text(databaseserverip,port,sid,schemaname,schemapassword))... how can store encrypted database information in oracle-ds.xml? how java code decode making jdbc connection?
Comments
Post a Comment