Kapoor,
This is possible and there are several ways to achieve it -- depending on the Oracle database version you are using. If you have at least Oracle 8i, then one way would be to use a java stored procedure. You can find all the information you require at Oracle's
OTN Web site.
Good Luck,
Avi.