cancel
Showing results for 
Search instead for 
Did you mean: 

Java OLE connection problem with 16.5 64bit

Former Member
0 Kudos

Hi All,

After upgrading to the 64bit version of PowerDesigner I could no longer connect to PowerDesigner using Java. Ultimately it was a problem which I could only fix by modifying the jar file with the interop that comes with PowerDesigner. The interop in the installation is a 32bit version. Using this with a 32bit JVM and 32bit Eclipse library version resulted in an error telling me that PowerDesigner was not installed. Using it with the 64bit JVM and Eclipse libraries resulted in another error telling me that the function was not found.

Has anyone had similar problems using Java to connect to PowerDesigner? I have logged an incident with SAP but there is no solution yet from them.

If you have please respond, so I can make a better case for fixing it 🙂

Best regards,

Marcel

Accepted Solutions (1)

Accepted Solutions (1)

c_baker
Employee
Employee
0 Kudos

16.5.5 x64 was released with 32 and 64-bit Java support - a pdj2com_16.5.5.jar (32-bit JVM) and pdj2com_16.5.5x64.jar (64-bit JVM).

Both can be found in the PD installation directory.  The 32-bit is still in the 'Ole Automation\Java Samples\Create OOM' directory.

To use the 64.bit, you must use also the 64-bit Eclipse SWT dlls as well.

I have found that as long as you use the correct Eclipse SWT dlls and matching pdj2com .jar file, you can call PD automation even if you are using 32-bit Java to call 64-bit PD.  Now you can use 64-bit Java to call 64-bit PD.

(I had one of the engineers fix this a while ago, but it needed to get into the release code line.  You should not need to open a case, other than to perhaps add documentation in the new features).

Chris

Answers (1)

Answers (1)

former_member185199
Contributor
0 Kudos

how do you connect to powerdesigner with java? can you give some more details?

via the Eclipse Plugin???

regards

dj

Former Member
0 Kudos

Hi Dirk,

I connect from plain Java. I use Eclipse as the IDE and the PowerDesigner interop uses the COM library from Eclipse.

If you follow the instructions from the document in the installation folder of PowerDesigner under: "Ole Automation\Java Samples\JavaProxy.doc" it used to work without a problem with the 32bit version.

The code can be something like this (see the samples in the folder as well):

import org.eclipse.swt.internal.ole.win32.COM;

import com.sybase.stf.powerdesigner.PdCommon.Application;

import com.sybase.stf.powerdesigner.PdPDM.Model;

public class Test {

  public static void main(String[] args) {

  int hr = COM.OleInitialize(0);

  try{

  Application pdApp = Application.getInstance();

  if (pdApp != null){

  Model model = new Model(pdApp.GetActiveModel());

  System.out.println("Active model code: " + model.GetCode());

  }

  }catch (Exception e) {

  System.out.println("Something went wrong.");

  }finally {

  if (hr == COM.S_OK)

  COM.OleUninitialize();

  }

  }

}

The above prints the code of the model that is currently active in PowerDesigner.

Best Regards,

Marcel

Former Member
0 Kudos

Hi Schot,

I am trying to get the detaisls of a model in PD, But I am not able to get the details of active model.It is throughing error , No active model opend.

How to connect the reposotory of Powerdesigner from Java api?there is any way that we could enter server details?

Could you please help if you know this . Thank you.

Regards,

Sri.