This document identifies a
solution of sending e-mail through PL/SQL package using UTL_SMTP. Some mail
servers require a username and password to be supplied. To include the
username/password, some MAIL SERVERS are dependent upon following
steps
v Initialize the Oracle JVM.
v Load plsql.jar into the Oracle
JVM
Java Stored Procedure is
part of Oracle8i JServer package and is available with standard Oracle
installation. The advantage of Java Stored Procedure is:
- It is Platform Independent and same code will compile
and execute on any platform that Oracle is installed on.
- It is available with all editions of Oracle
Database
- Because Oracle has JVM build into it, it does not
have any third party dependencies.
- Allows Oracle to interact with other OS processes,
and can be used as a wrapper to securely interface with external
applications.
To initialize the JVM, you
should be connected as SYS user. Connect as SYS to InfoWave
server.
v At SQL prompt run the SQL file initjvm.sql
from $ORACLE_HOME/javavm/install directory. This execution takes some
time. Around 15 to 20 minutes. As this script load approximately 8000+ java
classes into database.
v Once the above step is complete also run the SQL file
initplsj.sql from $ORACLE_HOME/rdbms/admin. For this around 200+
classes get loaded into the database
v At command line change the directory to
$ORACLE_HOME. Start SQLPLUS and connect as SYS user. Execute the
following command at SQL prompt
v
call dbms_java.loadjava('-resolve
-force plsql/jlib/plsql.jar');
v
@$ORACLE_HOME/rdbms/admin/utltcp.sql
v
@$ORACLE_HOME/rdbms/admin/prvttcp.plb
v
@$ORACLE_HOME/rdbms/admin/utlsmtp.sql
v
@$ORACLE_HOME/rdbms/admin/prvtsmtp.plb