⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch06s02.html

📁 详细介绍了jboss3.0的配置等
💻 HTML
字号:
<html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Specifying a datasource</title><link rel="stylesheet" href="styles.css" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/styles.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets Vimages/callouts/"><link rel="home" href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html" title="JBoss 3.0 Documentation"><link rel="up" href="ch06.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch06.html" title="Chapter 6. Customizing JAWS"><link rel="previous" href="ch06.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch06.html" title="Chapter 6. Customizing JAWS"><link rel="next" href="ch06s03.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch06s03.html" title="JAWS Options"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="0" cellpadding="0" cellspacing="0" height="65"><tr height="65"><td rowspan="2"><img src="jboss.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/jboss.gif" border="0"></td><td rowspan="2" background="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="100%" align="right" valign="top"><a href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html"><img src="doc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/doc.gif" border="0"></a><a href="ch06.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch06.html"><img src="toc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/toc.gif" border="0"></a><a href="ch06.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch06.html"><img src="prev.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/prev.gif" border="0"></a><a href="ch06s03.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch06s03.html"><img src="next.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/next.gif" border="0"></a></td></tr><tr></tr></table><div class="section"><a name="d0e2081"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e2081"></a>Specifying a datasource</h2></div></div><p>A datasource is, mainly, a database plus a driver plus a connection pool. By 
default, jboss uses the Hypersonic datasource. To add another
datasource, you have to declare it as a JMX MLet: see Chapter 3.</p><p>The second ARG of this MLet is the JNDI name of the datasource, i.e. the name 
you have to use to access it. To tell JAWS to use this
datasource, simply add in your jaws.xml file a  &lt;datasource&gt;  tag 
with the JNDI name in it.</p><p>According to the type of the database, you probably also want to specify a 
type mapping for this datasource. A type mapping tells JAWS
which jdbc types, which sql types to use for the storage of your cmp fields. 
You just have to add a  &lt;type-mapping&gt;  tag with the name of the
type mapping in it. Type mappings for the most common databases are already 
defined in jboss in a file called standardjaws.xml. Their
names are listed here:</p><div class="itemizedlist"><ul><li><p><a name="d0e2091"></a>       Hypersonic SQL
       </p></li><li><p><a name="d0e2094"></a>       InstantDB
       </p></li><li><p><a name="d0e2097"></a>       Oracle 7/8
       </p></li><li><p><a name="d0e2100"></a>       PointBase
       </p></li><li><p><a name="d0e2103"></a>       PostgreSQL
       </p></li><li><p><a name="d0e2106"></a>       SOLID
       </p></li><li><p><a name="d0e2109"></a>       mySQL
       </p></li><li><p><a name="d0e2112"></a>       DB2
       </p></li><li><p><a name="d0e2115"></a>       DB2/400
       </p></li><li><p><a name="d0e2118"></a>       MS SQLSERVER
       </p></li><li><p><a name="d0e2121"></a>       InterBase
       </p></li><li><p><a name="d0e2124"></a>       Sybase
       </p></li><li><p><a name="d0e2127"></a>       SapDB
       </p></li><li><p><a name="d0e2130"></a>       Cloudscape
       </p></li></ul></div><p>For instance, if you want to use the Postgres Database that you have deployed 
in jboss.conf under the name InstantDB, this is how
your jaws.xml file should look like:</p><pre class="programlisting"> 
 &lt;jaws&gt;
   &lt;datasource&gt;InstantDB&lt;/datasource&gt;
   &lt;type-mapping&gt;InstantDB&lt;/type-mapping&gt;
   ...
 &lt;/jaws&gt;
  
</pre><p>If none of the predefined type mappings satisfies your needs, you can define 
your own type-mapping.</p></div><table border="0" cellpadding="0" cellspacing="0" height="65"><tr height="65"><td rowspan="2"><img src="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="432" height="79"></td><td rowspan="2" background="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="100%" align="right" valign="top"><a href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html"><img src="doc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/doc.gif" border="0"></a><a href="ch06.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch06.html"><img src="toc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/toc.gif" border="0"></a><a href="ch06.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch06.html"><img src="prev.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/prev.gif" border="0"></a><a href="ch06s03.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch06s03.html"><img src="next.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/next.gif" border="0"></a></td></tr><tr></tr></table></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -