O'Reilly logo

Expert Oracle and Java Security: Programming Secure Oracle Database Applications with Java by David Coffin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Rewrite and Refactor Method to Distribute Two-Factor Code

We are going to make one more pass at the distribute2Factor() method. We need to incorporate the application_id in several places. While we are here, we are also going to refactor the code with a bit more security and organization.

If you look back at this method in the last chapter, you will see that we have two dynamic queries: one query we build to get data from the HR.emp_mobile_nos table and others, and another query we build to update the v_two_fact_cd_cache view. For security, we prefer parameterized procedures and functions to dynamic queries. This method and these dynamic queries run in the Oracle database and are unlikely to be susceptible to SQL injection, but we should consider ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required