J2EE应用是未来的趋势,.Net也是。所有的一切应用最终会以Web为基础,所谓互联正是如此。在分布式的架构中J2EE/Cobra都是不错的,至于选择哪一种是根据应用内容和实际开发能力裁定的,根本不冲突。J2EE/Cobra两者都可以作为跨平台应用的基础,而Web Services的作用并不仅仅是跨平台,更重要的是统一不同平台的应用,共享服务,减少由于开发环境引起的限制。为什么要用JAVA?原因之一就是开放,对任何开发者他都是完全公开透明的。另外就是平台无关性,J2EE架构的语言基础,也是众多厂家的卖点。至于Java组件的开发,那只是纯技术问题,跟应用没有关系,至多只是应用方案的备选方案之一。为什么要用Delphi?很简单,高效开发,组件化开发,支持的应用范围广。无论从C/S,MIDAS,Web Application, Web Services都具备很强的支撑能力,对于开发者来说,投入与产出的效果最好,VCL的精妙绝不亚于MFC的设计。在应用这方面,我们还是要向台湾兄弟学学。
WEB Services现在还是用在Internet上比较合适,因为它需要把数据转换成XML格式(也就是ASCII的格式),如果有二进制的数据,还需要用base64进行编码,转换需要时间,而且转换后的数据也比原始数据要大。如果不是异构系统的集成,还是不要用WEB Services的好。 至于manboo说的封装成ClientDataSet不如封装成XML来的划算的,borland中国的工程师认为,使用XML进行封装,增加了网络传送的负荷,降低了效率,所以他们不是很推荐使用。我曾经问过他们对前端用delphi,后端用java的系统如何实现,他们也没有提出什么解决办法。
http://www.kylecordes.com/story-103-windows-clients-java-servers.htmlPossible Solutions: Solution #1: Talk JRMP from Delphi Implement the Java RMI JRMP protocol in Delphi. This will be nearly impossible, since it is built on Java object serialization. So there are various approaches you could take.Solution #2: Java on the Client, use JNI Run Java on the client as well, and use JNI to communicate between Delphi and Java, then Java to do the client side RMI. This defeated the goal of keeping the client lean, though... a Delphi thin client can run well on an old, slow machine with 32 meg of RAM, Java can't.Solution #3: RMI-IIOP / CORBA Some Java application servers can seamlessly (?) expose Java services (like EJBs) as CORBA objects. Borland has CORBA support available for Delphi. This will avoid the overhead of Java on the client, but is too vendor-specific for my tastes.Solution #4: A Proxy on the server Use a non-RMI way to communicate between the Delphi client and an extra "tier" at the server; this piece of middleware would communicate with Delphi using any of a number of methods, even a proprietary protocol. Then use JNI or other means to access the Java services on the same (server) machine. This could be done using ASTA or MIDAS, among others.Solution #5: Web Services with SOAP Expose the server-side services as web services via SOAP. Choose an application server which will automatically expose your EJBs this way, if possible. Then use any available way to make a Delphi client talk SOAP. PureSOAP and Microsoft's SOAP support are two possible ways. (This is really the most appealing choice to me, as of 2001.)Solution #6: Homegrown web services It's really not all that hard to write wrapper code that exposes your server services via HTTP requests with parameters, via XML strings, etc. Such a thing would not be language specific, so the server could be on one language, the client in another. This solution has some appeal in cases where you want the pieces to be tightly "wrapped up" and not exposes in anything as standard as SOAP for some reason.
CORBA在Borland的各个产品中都能很好的实现,且跨平台。
Web Service借助于XML,在各平台通用,这时候已经无所谓哪个开发工具开发的了。
能具体给个CORBA或WEB SEVER的资料或元码吗?
这方面我实在是没做过
而且也找过很多资料
都是不太详细
多谢了!
-------------------------------------------------
www.nxit.net/bbs
愿于您一起交流
可能只有用CORBA但
谁具体写过CORBA?
还有是如何连接的呢?
我最近在研究这方面的东东,具体我想用.net来建立web service,而用Dephi7来做客户端程序,可以发挥dephi做界面的优势。现在web serbice已经建立,关于在dephi中调用和与.net的无缝集成上我还没有头绪,不知道哪位高手能否提供一些想法和资料呢?欢迎大家一起与我探讨!
我的QQ:67643937
通過DELPHI實現JAVA調用ORACLE資料庫資料
大慶採油六廠採油工藝研究所
王兵
---- 在開發WWW網路瀏覽軟體中,時常要用到JAVA畫一些生?管理圖形,而且大量的圖形資料存於網路資料庫ORACLE中,現在常用的方法是使用JDBC來實現對資料庫的操作,但是,如果手頭沒有它驅動程式,則就無法對資料庫進行操作。其實,我們可以使用DELPHI開發JAVA的ORACLE資料介面軟體,就具體實現方法簡述如下。 ---- 一、系統設置: ---- 1. 用SQL NET 設置ORACLE資料庫所在伺服器的IP地址別名,這裏假設名字是oracle1; ---- 2. 建立ORACLE ODBC資料源; ---- 進入控制面板的ODBC資料源,然後點擊Systen DSN,再點擊Add按鈕選擇Microsoft ODBC Driver Oracle,在Data Source Name框中輸入資料源名(test),在User Name框中輸入ORACLE資料用戶名(假設?user1)最後在Connect String框中輸入在SQL NET中建立的ORACLE資料庫別名oracle1; ---- 建立好以上兩步後,則DELPHI的BDE Administrator中自動生成一個test資料介面,如下圖: ---- 二、用DELPHI開發讀取ORACLE資料庫資料的CGI 程式 ---- 進入DELPHI編程環境,去掉FORM頁及其它控制項,然後輸入以下程式。 program testcgi;
{$apptype console}
uses
SysUtils, DBtables;
var
Table1: TTable;//用於讀ORACLE資料庫資料
Database1: TDatabase;//用於定義ORACLE別名及用戶名和口令
i,ss,code:integer;
my,cc:string;
begin
writeln('CONTENT-TYPE: TEXT/HTML');//CGI程式要求的資料頭資訊
writeln;//保留一行空格
my:=paramstr(1);//讀入JAVA傳來的資訊
Table1:=TTable.Create(nil);//創建Table控制項
Database1:=TDatabase.Create(nil);//創建Database控制項
try
Database1.aliasname:='test';//ORACLE別名
Database1.databasename:='test';
Database1.Params.Clear;
Database1.Params.add('USER NAME=user1');//用戶名
Database1.Params.add('PASSWORD=userpassword');//口令
Database1.loginprompt:=false;
Database1.connected:=true;
Database1.open; //打開資料庫通道
Table1.databasename:='test';
Table1.tablename:='cbkt';//ORACLE表名
table1.Active := True;
Table1.open;//打開ORACLE表
Table1.first;
//計算滿足條件井數
i:=0;
while (not table1.eof) do
begin
if (Table1.FieldByName('ny').asstring=my) then
begin
write(Table1.FieldByName('jh').asstring+',');
val(Table1.Fields[2].asstring,ss,code);
if ss>0 then
write(ss*100)
else
write('0.0');
write(',');
val(Table1.Fields[3].asstring,ss,code);
if ss >0 then
write(ss*100)
else
write('0.0');
end;
table1.next
end;
finally
table1.close;
table1.free;
end;
end.---- 把以上程式編譯後拷入伺服器的CGI目錄。
---- 三、JAVA部分程式
//test.java 編寫:王兵 1999/11/30
import java.awt.*;
import java.io.*;
import java.net.*;
import java.util.*;
import java.applet.*;
public class test extends Applet {
。。
。
//調用testcgi.exe實現讀入ORACLE資料
public boolean action(Event evt,Object obj)
{ String s1=(String)obj;
if(s1=="取資料")
return test_xx("http://10.65.76.64/scripts/testcgi.exe?"+
year.getSelectedItem());
return true;
}
public boolean test_xx(String post)
{。。
。。
try{DataInputStream is;//資料登錄流
URL url;//通過網傳資料
url=new URL(post);
URLConnection connection=url.openConnection();//打開資料流程
is=new DataInputStream(connection.getInputStream());
String inputline;
mcv.error=null;
if((inputline=is.readLine())==null)//無數據
{mcv.error=new String("無數據可讀!!!");
status_field.setText("無數據可讀!!!");
mcv.repaint();//畫布刷新
return true;
}
status_field.setText("取x,y資料...");
if ((inputline=is.readLine())==null)
{mcv.error=new String("無數據可讀!!!");
mcv.repaint();//畫布刷新
return true;
}
mcv.bktx=new String[10];
mcv.bkty=new String[10];
mcv.bktjh=new String[10];status_field.setText("取圖形資料...");
js=1;//計井數
for (i=0;i< 10;i++)
{//每行3個欄位
inputline=is.readLine();
if (inputline==null) {break;}
p1=inputline.indexOf(',');
p2=inputline.lastIndexOf(',');
mcv.bktjh[js]=inputline.substring(0,p1);
mcv.bktx[js]=inputline.substring(p1+1,p2).trim();
mcv.bkty[js]=inputline.substring(p2+1).trim();
status_field.setText("bktx["+
String.valueOf(js)+"]"+mcv.bkty[js]);
js=js+1;
}is.close();
status_field.setText("OK1");
mcv.repaint();
}catch(MalformedURLException me)
{System.err.println("MalformedURLException: "+me);}
catch(IOException ioe){
System.err.println("IOException: "+ioe);
}catch(NumberFormatException e)
{if(mcv.error==null)
mcv.error=new String("資料格式出錯B!!!"+e);
status_field.setText(mcv.error);
mcv.repaint();
}
status_field.setText("資料讀完!!!");
return true;}
}
。
---- 四、最後在自己的起始頁HTML文件中加入如下程式段就行了。 < !test.html 1999/11/30 >
< HTML >
< HEAD >
< BODY >
< APPLET CODE="test.class" WIDTH=200 HEIGHT=40 >< /APPLET >
< /BODY >
< /HTML >---- 以上程式在IBM 330 Server上調試通過,開發環境Visual J++ 6.0。
完全可以实现!用SOAP协议!
chechy(为程序而奋斗)你忙你就去忙吧!
分无所谓,这么好的话题怎么没人讨论?
偶不懂。学习java中……
大家可以看看这一贴:
http://expert.csdn.net/Expert/topic/912/912100.xml?temp=.4405481
如果使用EJB作为解决方案,那就整套全部用JAVA来做。有必要让DELPHI加进去吗?
而作为JAVA虽然垮平台等很多好处,但还是没有DELPHI做为前台开发的好!
应该是一种不错的解决方案
http://www.fcsoft.com.cn:8080/webreport/help/index.html WebPrint是一个在互联网环境下通用的打印底层。 http://www.fcsoft.com.cn:8080/webprintsample/index.html图形分析组件(WebGraph)主要用于分析网页中的数据并以各种图形的方式显示在页面中。
http://www.fcsoft.com.cn:8080/webgraphsample/index.htm
下载最新演示版(含e表2.0,WebPrint2.3和WebGraph2.0)(2002.10.10更新)
http://www.fcsoft.com.cn/fcwebComponent.zip
绝对一流,简洁,快速,高效,无所不能。
你没有中间件吗>?
我是想把报表等做为中间件放到应用服务器上!
所以必须考虑DELPHI连接JAVA的问题
1.技术架构可以采用Web Services。
2.服务部署可以采用J2EE架构,服务接口可以利用WSDL描述。
3.通过Soap可以很容易的访问用基于EJB部署的Web服务,Delphi6+ update Pack2 中已经有很好的Web Services的支持,可以根据WSDL直接生成接口单元,动态调用服务;当然也可用MSTK提供的API对Web服务进行调用,这种方式结构松散,耦合度底,推荐使用。
MaJianGZ(绿树火焰) ( ):说的很到位
你具体做过吗?自定义报表的中间件有没有经验?
Ejb--Corba--delphi
也许是最好的一种解决方案了。
本人不喜欢这种模式。
推荐一本书,主要讲到了delphi如何利用soap技术与各种中间件,组件模型沟通,你的这个问题树上讲得很透彻
《DELPHI6/KYLIX2 SOAP/WEB SERVICE程序设计》作者:李维
其实用delhi实现com_+或者corba将来还要支持.net
为什么非要java做中间件呢,后台数据库,我的想法是最好何数据库系统无关,数据库用来保存数据即可,不主张写相关数据库的程序。
java做中间件的优势也就是j2ee,不过我没有用过,不知道怎么样
跨平台其实采用webservice技术就可以解决了,delphi也很好的支持。
无论什么方案,实用为本。
!
IBM的DB2极其腐败!个人观点!
至于manboo说的封装成ClientDataSet不如封装成XML来的划算的,borland中国的工程师认为,使用XML进行封装,增加了网络传送的负荷,降低了效率,所以他们不是很推荐使用。我曾经问过他们对前端用delphi,后端用java的系统如何实现,他们也没有提出什么解决办法。
可以讨论:[email protected]
Solution #1: Talk JRMP from Delphi
Implement the Java RMI JRMP protocol in Delphi. This will be nearly impossible, since it is built on Java object serialization. So there are various approaches you could take.Solution #2: Java on the Client, use JNI
Run Java on the client as well, and use JNI to communicate between Delphi and Java, then Java to do the client side RMI. This defeated the goal of keeping the client lean, though... a Delphi thin client can run well on an old, slow machine with 32 meg of RAM, Java can't.Solution #3: RMI-IIOP / CORBA
Some Java application servers can seamlessly (?) expose Java services (like EJBs) as CORBA objects. Borland has CORBA support available for Delphi. This will avoid the overhead of Java on the client, but is too vendor-specific for my tastes.Solution #4: A Proxy on the server
Use a non-RMI way to communicate between the Delphi client and an extra "tier" at the server; this piece of middleware would communicate with Delphi using any of a number of methods, even a proprietary protocol. Then use JNI or other means to access the Java services on the same (server) machine. This could be done using ASTA or MIDAS, among others.Solution #5: Web Services with SOAP
Expose the server-side services as web services via SOAP. Choose an application server which will automatically expose your EJBs this way, if possible. Then use any available way to make a Delphi client talk SOAP. PureSOAP and Microsoft's SOAP support are two possible ways. (This is really the most appealing choice to me, as of 2001.)Solution #6: Homegrown web services
It's really not all that hard to write wrapper code that exposes your server services via HTTP requests with parameters, via XML strings, etc. Such a thing would not be language specific, so the server could be on one language, the client in another. This solution has some appeal in cases where you want the pieces to be tightly "wrapped up" and not exposes in anything as standard as SOAP for some reason.
还可以!
当然可以实现.
用CORBA/J2EE/WEBSERVICES都可以做,要不然自己做个中间件也可以做,呵呵。
我的项目就是Delphi+VisiBroker/BES(corba/j2ee技术)+JB+Oracle+linux.
目前项目一期已经将近结束。
欢迎对分布式对象计算技术感兴趣的人与我联系[email protected]。