This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Hi, I want to create DLL's in Java. To be more precise, I want to call Java methods from PowerBuilder. PowerBuilder has the option of creating Proxy objects but that works with PowerSuite. I have a plain powerbuilder application. Can anybody tell me whether it's possible to create DLL's in Java and is there any other workaround. Thanks, Raj
Java does not create DLLs. The usual ways for Java classes to work together with non-Java objects is through JNI, IP sockets or CORBA. Of these, JNI is most usefull for having Java classes access resources that cannot be accessed directly. The other two require a server to be running (in the case of direct socket comm., you have to write one yourself, CORBA servers can be purchased at substantial cost). AFAIK there is no language binding for Powerbuilder to CORBA, so you cannot use that, which in your case leaves direct communication over IP sockets (if Powerbuilder can do so). You need to create two programs: 1 in Powerbuilder and another in Java. The Java program listens to incoming requests on a port you decide upon. When a recognised request (best are plain text strings) is received a new thread is launched to handle the request and pass the result back to the requester.