关于JAVA/CORBA的使用问题!!!50分求助,不够可加
最近想学习下用JAVA/CORBA方式进行LOTUS的访问!谁能给个例子或者配置环境说明或者思路???还有一个就是在LOTUS中如何用纯JDBC来连MMSQL的数据库!我用LS是可以连的!现在想试试纯JDBC方式!以上分为两个问题解决一个给50分!!! 问题点数:0、回复次数:9Top
1 楼MitchJuan()回复于 2004-11-03 08:30:29 得分 0
Running a Java program
You can call the Domino Objects from a Java program by importing the lotus.domino package. The program can be coded as an application, a Domino agent, an applet, or a servlet. Local calls access run-time code on the local computer, which must have Domino installed. CORBA-based remote (IIOP) calls access run-time code from a remote Domino server; in this case, the local computer need not have Domino installed. Compilation must be on a computer with Domino Designer Release 5 installed.
注释 The lotus.domino package has the same content as the Release 4.6 lotus.notes package plus new classes, methods, and other enhancements. The Release 4.6 lotus.notes package continues to be supported for backwards compatibility only; it does not contain the new classes, methods, and other enhancements.
Examples: Running a Java program
This is an application that makes local calls and uses the static NotesThread methods:
import lotus.domino.*;
public class platform3
{
public static void main(String argv[])
{
try
{
NotesThread.sinitThread();
Session s = NotesFactory.createSession();
String p = s.getPlatform();
System.out.println("Platform = " + p);
}
catch(Exception e)
{
e.printStackTrace();
}
finally
{
NotesThread.stermThread();
}
}
}
Top
2 楼MitchJuan()回复于 2004-11-03 08:32:53 得分 0
纯JDBC方式连接数据库就是用java代码写那段连接数据库的代码吧,原理相同,只是语法格式不一样罢了
Top
3 楼sujianyu(懒猫)回复于 2004-11-03 09:38:32 得分 0
我给你写一个JDBC连接mySql ,与连接其他数据库一样,替换URL和驱动就可以了。
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
dbCur = agentContext.getCurrentDatabase();
}
catch(Exception e){
e.printStackTrace();
}
try{
con = DriverManager.getConnection("jdbc:mysql://mySqlhost/jbossdb?user=domino&password=123456&useUnicode=true&characterEncoding=GB2312");
stmt = con.createStatement();
}catch(SQLException ex){
ex.printStackTrace();
System.out.println("SQLException" + ex.getMessage());
System.out.println("SQLState" + ex.getSQLState());
System.out.println("SQLErrorCode" + ex.getErrorCode());
}
if (stmt != null){
rs = stmt.executeQuery("SELECT * FROM testtable");
}Top
4 楼lengfengzhuiyue(冷风追月)回复于 2004-11-03 21:05:54 得分 0
TO:sujianyu(懒猫)谢谢您!我在LOTUS之外的环境是可以连的!我现在是想在LOTUS中通过代理或者别的方式来连连看!主要是不知道我的驱动程序如何放!还有这样连可以吗?主要是想用JAVA代理来交换LOTUS和关系数据库中的数据!(想实时交换!)Top
5 楼Tiansha112(tiansha)回复于 2004-11-03 21:07:31 得分 0
顶!Top
6 楼sujianyu(懒猫)回复于 2004-11-04 09:42:02 得分 0
lengfengzhuiyue(冷风追月):这段代码可以写在代理中。一样的,我就是从代理中摘出来的部分代码。Top
7 楼maplescloud(风清云淡)回复于 2004-11-05 09:30:30 得分 0
如果你用JAVA代理,把需要的包都引入到代理里面去。Top
8 楼lengfengzhuiyue(冷风追月)回复于 2004-11-05 10:21:02 得分 0
TO:maplescloud(枫之遐想)是的,要引到代理中去那比如说我有个自定义的包叫做good里面有个类为Good那么我要把这个包放到LOTUS目录的什么地方?做什么操作后才可以在代理中用这样的语句引入??
import good.Good;求教!!!盼您回复!
Top
9 楼sujianyu(懒猫)回复于 2004-11-08 16:48:23 得分 0
你在java代理中,点编辑项目按钮。然后选择要用的文件,具体操作我就不说了。Top




