Email from EBS - Addendum
By Tim Dexter-Oracle on Aug 24, 2006
The fax article is on the way but since I came up with the email solution there has always been the niggling fact that I was putting the EBS user name/password openly into my java class ... there had to be a better a solution !
There is, and thanks to Ashish from the dev team and a little work I found it. The OA Framework UI uses a DBC file to define the connection and other information to the EBS database and we can use that to get a connection to the database instead of hard coding the connection.
The file resides under the $FND_TOP/secure directory, check it out you'll have one. It will look similar to this:
#Sun Sep 04 13:02:20 PDT 2005
there is also an environment variable called $FND_SECURE which will point to the file location.
To take advantage of the file and its contents and make your java class a whole lot more secure you can pass the FND_SECURE value and the dbc file name to the class via the driver i.e. $FND_SECURE/file.dbc
Then in your class add the following:
the getConnection method becomes very simple
static Connection getConnection() throws SQLException, Exception
AppsContext aCont = new AppsContext(dbcLocation);
Connection aConn = aCont.getJDBCConnection();
where dbcLocation is a string that holds the new parameter passed from the driver. The rest of the class remains the same.
So now you have a much more secure method to get the connection. Just be sure to close it after you have finished so the connection returns to the connection pool. Much cleaner, neater and faster :o)