I have a java class that should transfer data from the current database to another server. To access the current database, it seems that Java needs a working Session
object:
public class EdgeServerConnection
{
public EdgeServerConnection(Session session) {
try {
// How to get the session into here?
Database db = session.getCurrentDatabase();
...
} catch(Exception e) {
}
}
}
The class should be called from a LotusScript agent, somehow like this:
Set session = New NotesSession
Set jsession = New JAVASESSION
Set connectionClass = jsession.GetClass("EdgeServerConnection")
Set connectionObject = connectionClass.CreateObject("(L/lotus/notes/Session;V)", session)
But this throws the error
LS2J: java constructor failed to execute
If I remove the Session parameter from both the constructor and the CreateObject call, the error goes away.
How can I get the agent session into the java class?