-
1. Re: configure entity bean to access sqlserver
laz777 Feb 26, 2002 4:41 AM (in response to zhebincong)which version of jboss/tomcat are you running?
Here's a quick rundown for JBoss 2.4.4 with catalina:
you need to setup a pool in the $JBOSS_HOME/conf/catalina/jboss.jcml file
here is an example of mine (for postgres):
DefaultDS
org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl
jdbc:postgresql:dev_db
1200000
toddm
10
yourpass
false
false
false
true
120000
1800000
false
false
1.0
0
put your JDBC driver info into the "URL" attribute, and your login and password info into the "JDBCUser" and "Password" attributes.
if you want to use a datasource other than the DefaultDS
you'll need to add a jaws.xml file to the same place you are putting the ejb-jar.xml for your EJB.
Here is an example of one of my jaws.xml files:
<?xml version="1.0" encoding="UTF-8"?>
TestDev
<enterprise-beans>
<ejb-name>FUser</ejb-name>
<cmp-field>
<field-name>login_name</field-name>
<column-name>login_name</column-name>
<jdbc-type>VARCHAR</jdbc-type>
<sql-type>VARCHAR UNIQUE</sql-type>
</cmp-field>
<cmp-field>
<field-name>user_type</field-name>
<column-name>user_type</column-name>
<jdbc-type>INTEGER</jdbc-type>
<sql-type>INTEGER</sql-type>
</cmp-field>
<cmp-field>
<field-name>cdate</field-name>
<column-name>cdate</column-name>
<jdbc-type>DATE</jdbc-type>
<sql-type>DATE</sql-type>
</cmp-field>
<cmp-field>
<field-name>last_login</field-name>
<column-name>last_login</column-name>
<jdbc-type>DATE</jdbc-type>
<sql-type>DATE</sql-type>
</cmp-field>
findByLoginName
WHERE login_name = '{0}'
<ejb-name>FAddress</ejb-name>
</enterprise-beans>
Hope this helps....
-Todd