Consultor Eletrônico



Kbase P28626: Using Java Open Client With Smartdataobject
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
Status: Unverified

GOAL:

Using Java Open Client With Smartdataobject

GOAL:

Example code to access the sdo from a Java session using Open Client:
// MyDaccusr is the name of the AppObject in ProxyGen
MyDaccusr mydaccusr = null;
String daccusrSdo = "account/domain/daccusr.w";

public void connectToAppServer() throws Exception {
mydaccusr =
new MyDaccusr("AppServer://myhost:5162/ecommapsv", "", "", null);

System.out.println("After connect to AppServer");
}

public void openQuery() throws Exception {

try {
if (mydaccusr == null)
System.out.println("Invalid apphandle");
jdaccusr = mydaccusr.createPO_daccusr();
}
catch {
System.out.println("Error starting sdo");
}


// And MyDaccusr.java has this code:
public daccusr createPO_daccusr()
throws Open4GLException, RunTime4GLException, SystemErrorException
{
return new daccusr(m_MyDaccusrImpl);
}

// And jdaccusr can be used to call internal procs:
jdaccusr.myproc( int custNum, custTableHolder ):

FIX:

Basic method is to connect to AppServer, start the sdo procedure persistently and then call the internal procedures as required