Hi! *Is it possible to connect SIEM DB from WF Activity using
IDMRPTDataSource?* I try to connect this way in order to hide a real
pass of the admin user.
The code is follows:

Code:
--------------------

function getConnection(ip, port, dbName, userName, pass) {
var connection = null;

/*
try {
var Driver = new Packages.java.lang.Class.forName("org.postgresql.D river"); //load the driver
connection = Packages.java.sql.DriverManager.getConnection("jdb costgresql://" + ip + ":" + port + "/" + dbName + "", userName , pass);
var dbmd = connection.getMetaData(); //get MetaData to confirm connection
java.lang.System.out.println("Connection to "+dbmd.getDatabaseProductName()+" "+
dbmd.getDatabaseProductVersion()+" successful.");
} catch (ex) {
java.lang.System.out.println("Exception: " + ex);
}
*/

try {
var ctx = new Packages.javax.naming.InitialContext();
var ds = ctx.lookup("java:/comp/env/IDMRPTDataSource");
connection = ds.getConnection();
} catch (ex) {
java.lang.System.out.println("### getConnection error: " + ex.toString());
}

return connection;
}

--------------------

And I got an error:

Code:
--------------------
JavaException: javax.naming.NameNotFoundException: IDMRPTDataSource not bound
--------------------


--
hello_amigo
------------------------------------------------------------------------
hello_amigo's Profile: https://forums.netiq.com/member.php?userid=211
View this thread: https://forums.netiq.com/showthread.php?t=54005