📄 使用说明.htm
字号:
System.out.println("inputTime:"+message.getInputTime());<BR>
System.out.println("status:"+message.getStatus()); <BR> }<BR>
}<BR> }<BR> }</P>
<P>
如上面的代码所示,程序只需要通过EasyJDB的getInstance()方法得到一个实例,然后就可以通过EasyJDB对象的save、update、del、get、query等类似的方法进行数据库的操作了。而程序员不用管具体的数据库系统类型、不用管数据库连接的获取、数据库资源的释放、不用构造烦琐无味的Sql添、删、改、查语句。<BR>
关于数据源及配置文件:用户可以通过EasyDBO的配置文件easyjf-dbo.xml文件配置数据库连接数据源,也可以程序中设置数据源,还可通过IOC容器设置数据源。下面我们看看EasyDBO的数据源配置文件easyjf-dbo.xml的内容。<BR>
<easyjf-dbo><BR> <datasource id="bbs"
type="org.apache.commons.dbcp.BasicDataSource"><BR>
<property
name="easydbo.connection.driver_class">org.gjt.mm.mysql.Driver</property><BR>
<property
name="easydbo.connection.password">yourpassword</property><BR>
<property
name="easydbo.connection.url">jdbc:mysql://127.0.0.1:3306/easyjf</property><BR>
<property
name="easydbo.connection.username">root</property><BR>
<property
name="easydbo.dialect">com.easyjf.dbo.sql.MySqlQuery</property><BR>
<property name="easydbo.optimize">true</property><BR>
<property name="esyydbo.show_sql">true</property><BR>
</datasource><BR> <tables><BR> <class><BR>
</class><BR> </tables><BR> </easyjf-dbo></P>
<P> 假如用户使用的是MS Sql Server数据为,把上面的的配置文件修改成如下的内容即可:<BR>
<easyjf-dbo><BR> <datasource id="bbs"
type="org.apache.commons.dbcp.BasicDataSource"><BR>
<property
name="easydbo.connection.driver_class">com.microsoft.jdbc.sqlserver.SQLServerDriver</property><BR>
<property
name="easydbo.connection.password">sa</property><BR>
<property
name="easydbo.connection.url">jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=easyjf;SelectMethod=cursor</property><BR>
<property
name="easydbo.connection.username">yourpassword</property><BR>
<property
name="easydbo.dialect">com.easyjf.dbo.sql.MSSqlServerQuery</property><BR>
</datasource><BR> <tables><BR> <class><BR>
</class><BR> </tables><BR> </easyjf-dbo></P>
<P><STRONG>六、选择适合你的对象-关系映射中间件</STRONG><BR>
不是功能最全,用得最多的中间件就一定适合您,当前流行的各种ORM中间件产品中,hibernate无疑是最为出色的产品,从系统的构架、性能及功能上都非常好。在大型分布市群集服务器运用领域,EJB
Entity
Beans是首选,因为其有广泛的市场及运用基础。当然,在小型的数据库应用软件领域,如一个新闻网站、一个简单的网上商店、论坛系统等,笔者也推荐大家不防试试EasyDBO。作为初学者,笔者推荐大家使用EasyDBO,阅读EasyDBO的源代码,可以让你快速掌握及了解ORM中间件的实质及工作原理,从而为学习及使用功能更加强大对象-关系映射中间件产品打下基础。<BR>
更多完整的有关EasyDBO应用实例代码,请通过官方网站<A
href="http://www.easyjf.com/">http://www.easyjf.com/</A>下载。<BR></P>
<P>附件:<A
href="http://www.easyjf.com/download/easydbo/EasyDBO_Example.zip"
target=_blank><FONT color=#0000cc>本文源代码</FONT></A><BR></P>
<P>(转载请保留作者及来源信息)<BR></P></TD></TR>
<TR>
<TD vAlign=top> </TD></TR>
<TR>
<TD vAlign=top align=middle>【<A
href="http://www.easyjf.com/bbsdoc.ejf?easyJWebCommand=show&&cid=1135263636745115">评论</A>】 【<A
class=black
href="javascript:window.close()">关闭</A>】</TD></TR></TBODY></TABLE></TD>
<TD vAlign=top width=200 bgColor=#ececec rowSpan=2>
<TABLE width="100%" border=0>
<TBODY>
<TR>
<TD>
<TABLE style="BORDER-LEFT: #ececec 1px solid" cellSpacing=0
cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD vAlign=center background=readme_files/bt_bg.gif><A
onclick="return false;"
href="http://www.easyjf.com/easyjweb/index.htm"><STRONG>项目简介</STRONG></A></TD></TR>
<TR>
<TD bgColor=#ffffff height=30>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD height=10>·<A
href="http://www.easyjf.com/easydbo/quickstart.htm#">EasyDBO</A></TD></TR>
<TR>
<TD height=10><A
href="http://www.easyjf.com/easydbo/quickstart.htm#">·持久层框架简介</A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD background=readme_files/bt_bg.gif height=35><A
onclick="return false;"
href="http://www.easyjf.com/easydbo/quickstart.htm"><STRONG><FONT
color=#000000>快速入门</FONT></STRONG></A></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD background=readme_files/bt_bg.gif height=35><A
href="http://www.easyjf.com/easydbo/download.htm"><STRONG><FONT
color=#000000>程序下载</FONT></STRONG></A></TD></TR>
<TR>
<TD>
<P>·<A
href="http://www.easyjf.com/download/easydbo/EasyDBO_0.1.0_src.zip">EasyDBO_0.1.0_src.zip</A></P></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD> </TD></TR>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD background=readme_files/bt_bg.gif height=35><A
href="http://www.easyjf.com/easydbo/doc/"
target=_blank><STRONG><FONT
color=#000000>API文档</FONT></STRONG></A></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD background=readme_files/bt_bg.gif height=35><STRONG><FONT
color=#000000>开发教程</FONT></STRONG></TD></TR>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD height=20>·EasyDBO教程</TD></TR>
<TR>
<TD height=20>·Spring教程</TD></TR>
<TR>
<TD height=20>·hibernate教程</TD></TR>
<TR>
<TD
height=20>·软件开发过程及管理</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD background=readme_files/bt_bg.gif
height=35><STRONG>联系我们<FONT
color=#000000></FONT></STRONG></TD></TR>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD height=10>·QQ群:18230172</TD></TR>
<TR>
<TD height=2>·站长邮箱(MSN):</TD></TR>
<TR>
<TD align=middle height=3>caishiyou<IMG height=12
src="readme_files/hotmail.gif" width=81 align=absMiddle>
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=778 align=center border=0>
<TBODY>
<TR>
<TD height=15> </TD></TR>
<TR>
<TD bgColor=#1f80cb height=8></TD></TR>
<TR>
<TD height=2></TD></TR>
<TR>
<TD align=middle bgColor=#1f80cb height=24><A
href="http://www.easyjf.com/aboutus.htm"><FONT
color=#ffffff>Aboutus</FONT></A> | <A
href="http://www.easyjf.com/linkus.htm"><FONT
color=#ffffff>联系我们</FONT></A> | <FONT color=#ffffff>程序开发</FONT> | <FONT
color=#ffffff>网站地图</FONT> | <FONT color=#ffffff><A
href="http://www.easyjf.com/guestbook.ejf"><FONT
color=#ffffff>留言板</FONT></A></FONT> </TD></TR>
<TR>
<TD align=middle bgColor=#1f80cb height=25><FONT color=#ffffff>Copyright
(C) 2005 EasyJF.com, All Rights Reserved <BR>版权所有 简易java框架网<BR>川ICP备号
如有意见请与我们联系 Powered by EasyJFramework</FONT><SPAN style="DISPLAY: none">
<SCRIPT language=JavaScript src="readme_files/counter.php"
type=text/javascript></SCRIPT>
</SPAN></TD></TR>
<TR>
<TD height=6></TD></TR></TBODY></TABLE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -