要求服务器端使用JDK1.4,客户端使用Delphi6/7,采用IIOP互联,不使用visibroker,请教高高手,如果实现互联,最好能提供实例或是相关主页文章连接。分数不是问题,答得的创意,送上几百分!
解决方案 »
- 我的delphi2010里咋没有Excel相关的控件了呢?
- delphi中怎样让Label组件成一定角度放置在窗体上
- 如果想要把richedit里的文件存入到数据库中的两个问题(菜鸟送分)!
- 各位大峡,请问如何将fastreport制作的报表保存成word文挡?
- 关于路径问题,各位大虾帮帮忙,急!
- database组件应该怎样连接数据库,她的属性应该怎样设置?在线等。
- Delphi建文件夹?????
- windows的标准字体是什么?
- 怎么让TListBox透明
- 送掉所有的分数(来就有分):不知各位大哥用Delphi在单机上做数据库程序时,都用的是哪一种数据库格式?我原来用paradox,但是好容易坏掉,数据经常丢失
- MessageDlg 怎样预设按纽
- 如何添加一个xml文件的节点?
IDL文件如下:
module ArithApp {
interface Add {
const unsigned short SIZE=10;
typedef long array[SIZE];
void addArrays(in array a, in array b,
out array result);
};
};
import ArithApp.*;
import org.omg.CORBA.*;
import org.omg.CosNaming.*;
import org.omg.PortableServer.*;
import org.omg.PortableServer.POA;public class AddServer { public static void main(String args[]) {
try {
// create and initialize the ORB
ORB orb = ORB.init(args, null); // create an implementation and register it with the ORB
AddImpl impl = new AddImpl(orb); // get reference to rootpoa & activate the POAManager
POA rootpoa =
POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
rootpoa.the_POAManager().activate(); // get object reference from the servant
org.omg.CORBA.Object ref = rootpoa.servant_to_reference(impl);
Add href = AddHelper.narrow(ref); // get the root naming context
// NameService invokes the name service
org.omg.CORBA.Object objRef =
orb.resolve_initial_references("NameService");
// Use NamingContextExt which is part of the Interoperable
// Naming Service (INS) specification.
NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef); // bind the Object Reference in Naming
String name = "Add";
NameComponent path[] = ncRef.to_name(name);
ncRef.rebind(path, href); System.out.println("AddServer ready to add up your arrays...."); // wait for invocations from clients
orb.run();
} catch (Exception e) {
System.err.println("ERROR: " + e);
e.printStackTrace(System.out);
}
System.out.println("AddServer Exiting ....");
}
}
import ArithApp.*;
import org.omg.CORBA.*;class AddImpl extends AddPOA {
private ORB orb; public AddImpl(ORB orb) {
this.orb = orb;
} // implement the addArrays() method
public void addArrays(
int a[],
int b[],
ArithApp.AddPackage.arrayHolder result) { result.value = new int[ArithApp.Add.SIZE]; for (int i = 0; i < ArithApp.Add.SIZE; i++) {
result.value[i] = a[i] + b[i];
}
}
}