Configuring JBoss 4.0 JDBC Connectivity
by Deepak Vohra02/25/2004
JBoss 4.0, developer edition, is an open source application server configured to use HypersonicDB by default. However, some Java 2 Platform Enterprise Edition (J2EE) developers would like to use databases other than HypersonicDB to develop and deploy applications. In this tutorial, we'll look at how to configure JBoss to use other databases.
Overview
The JBoss 4.0 server makes use of Java Database Connectivity (JDBC) configuration files to configure the server. The JBoss application server provides data source access for Enterprise Java Beans (EJB) persistence, and other for J2EE applications. To use the server with a database other than the default database, Hypersonic, these configuration files have to be modified. This article is structured into the following sections:
- JBoss Deployment Descriptors for EJBs
- Oracle Database Configuration
- MySQL Database Configuration
- Sybase Database Configuration
- DB2 Database Configuration
- Informix Database Configuration
JBoss Deployment Descriptors for EJBs
standardjaws.xml is the standard deployment descriptor for the mapping of Container Managed Persistence (CMP) entity EJBs. To use a custom configuration for mapping CMP entity EJBs, you use the jaws.xml file instead. In both cases, the file is copied to the META-INF directory of the EJB .jar file. Whichever file is used configures the following:
|
Related Reading
|
- Specify a data source and a type mapping for the data source.
- Specify how tables are built/used.
- Define finder methods to access the entity beans.
- Define type mappings.
A data source is a Java Naming and Directory Interface (JNDI) object used to obtain a connection from a connection pool to a database. The default data source configured with JBoss 4.0 is the HypersonicDB data source. To use another database, you need to modify jaws.xml or standardjaws.xml.
standardjbosscmp-jdbc.xml is the standard deployment descriptor to configure the JBoss CMP container. It can be replaced with a custom configuration version, called jbosscmp-jdbc.xml. As before, this file goes in the META-INF directory of the EJB .jar file. And once again, JBoss 4.0 defaults to a Hypersonic version, in this case HypersonicDB cmp. To use another database, we need to edit this file.
Oracle Configuration
Oracle is a very popular enterprise database used for its
performance and reliability. To configure JBoss 4.0 with Oracle, we first
need to put
Oracle's driver classes in the CLASSPATH. Copy
Oracle's JDBC driver .zip file /jdbc/lib/classes12.zip
to the server/default/lib directory.
To use Oracle's transactional (XA) data source, copy /docs/examples/jca/oracle-xa-ds.xml to the /server/default/deploy directory. To configure with the non-XA data source, copy /docs/examples/jca/oracle-ds.xml instead, to /server/default/deploy dir.
Next, we need to modify the oracle-ds.xml
configuration file. The <driver-class/> and
<connection-url/> settings for Oracle are
as follows:
Oracle OCI Type 2 Driver
- Class:
oracle.jdbc.driver.OracleDriver - URL:
jdbc:oracle:oci8:@<database>
Oracle OCI Thin Type 4 Driver
- Class:
oracle.jdbc.driver.OracleDriver - URL:
jdbc:oracle:thin:@<host>:<port>:<database>
Oracle OCI XA Type 2 Driver
- Class:
oracle.jdbc.xa.client.OracleXADataSource - URL:
jdbc:oracle:thin:@<host>:<port>:<database>
Oracle OCI Type 2 Driver
- Class:
oracle.jdbc.driver.OracleDriver - URL:
jdbc:oracle:oci8:@<database>
In the Connection URL setting, <host> is the HOST value specified in the
/network/ADMIN/tnsnames.ora file, and
<port> is the PORT value
specified in the tnsnames.ora file, and
<database> is the database name.
Next, we modify the standardjaws.xml or
jaws.xml configuration file.
Set the <datasource> and
<type-mapping> elements as follows:
<jaws>
<datasource>java:/OracleDS</datasource>
<type-mapping>Oracle8</type-mapping>
</jaws>
Next, we modify the standardjbosscmp-jdbc.xml or
jbosscmp-jdbc.xml configuration file, setting the
<datasource> and <datasource-mapping> elements to use Oracle:
<jbosscmp-jdbc>
<defaults>
<datasource>java:/OracleDS</datasource>
<datasource-mapping>Oracle8</datasource-mapping>
</defaults>
</jbosscmp-jdbc>
Finally, we need to modify login-config.xml to use Oracle.
Add the following <application-policy> element to login-config.xml:
<application-policy name = "OracleDbRealm">
<authentication>
<login-module code =
"org.jboss.resource.security.ConfiguredIdentityLoginModule"
flag = "required">
<module-option name = "principal">sa</module-option>
<module-option name = "userName">sa</module-option>
<module-option name = "password"></module-option>
<module-option name ="managedConnectionFactoryName">
jboss.jca:service=LocalTxCM,name=OracleDS
</module-option>
</login-module>
</authentication>
</application-policy>
By modifying the oracle-ds.xml, standardjaws.xml, standardjbosscmp-jdbc.xml, and login-config.xml files, the JBoss 4.0 server is configured to be used with a Oracle database.
MySQL Database Configuration
MySQL is an open source database used by many open source projects
and small organizations. To use JBoss 4.0 with MySQL,
we first need to put the MySQL driver classes into the CLASSPATH.
Copy the .jar file mysql-connector-java-3.0.9-stable-bin.jar
to the /server/default/lib directory.
To use the MySQL data source, copy /docs/examples/jca/mysql-ds.xml to the
/server/default/deploy directory. Modify the mysql-ds.xml configuration file by setting
<driver-class/> to com.mysql.jdbc.Driver
and <connection-url/> to
jdbc:mysql://<mysqlhost>/<database>,
where <mysqlhost> is the MySQL host server
and <database> is the MySQL database.
Next, we need to set the <datasource> and
<type-mapping> elements in the
standardjaws.xml or jaws.xml file:
<jaws>
<datasource>java:/MySqlDS</datasource>
<type-mapping>mySQL</type-mapping>
</jaws>
We also need to set the <datasource> and
<datasource-mapping> elements in the
standardjbosscmp-jdbc.xml or jbosscmp-jdbc.xml file:
<jbosscmp-jdbc>
<defaults>
<datasource>java:/MySqlDS</datasource>
<datasource-mapping>mySQL</datasource-mapping>
</defaults>
</jbosscmp-jdbc>
Finally, we modify login-config.xml with MySQL
database settings. Add the following <application-policy/> element
to login-config.xml:
<application-policy name = "MySqlDbRealm">
<authentication>
<login-module code =
"org.jboss.resource.security.ConfiguredIdentityLoginModule"
flag = "required">
<module-option name ="principal">sa</module-option>
<module-option name ="userName">sa</module-option>
<module-option name ="password"></module-option>
<module-option name ="managedConnectionFactoryName">
jboss.jca:service=LocalTxCM,name=MySqlDS
</module-option>
</login-module>
</authentication>
</application-policy>
By modifying the mysql-ds.xml, standardjaws.xml, standardjbosscmp-jdbc.xml, and login-config.xml files, the JBoss 4.0 server is configured to be used with a MySQL database.
Sybase Database Configuration
Sybase Adaptive Server Enterprise (ASE) is a database server by
Sybase Inc. ASE is used on both UNIX and Linux platforms. As before, the
first step is getting the database driver classes into the CLASSPATH,
by copying the .jar file jconn2.jar to the
/server/default/lib directory. Then use its data source by
copying /docs/examples/jca/sybase-ds.xml to
/server/default/deploy dir.
Modify the sybase-ds.xml configuration file, setting
<driver-class/> to com.sybase.jdbc2.jdbc.SybDriver
and <connection-url/>
to jdbc:sybase:Tds:<host>:<port>/<database>, where
<host> is the Sybase host server, <port> is the Sybase
host server port number, and <database> is the Sybase
database name.
Then, as before, we need to modify standardjaws.xml
or jaws.xml to set the <datasource> elements: and<type-mapping>
<jaws>
<datasource>java:/SybaseDS</datasource>
<type-mapping>Sybase</type-mapping>
</jaws>
We also need to modify standardjbosscmp-jdbc.xml or
jbosscmp-jdbc.xml to set the <datasource> and
<datasource-mapping> elements:
<jbosscmp-jdbc>
<defaults>
<datasource>java:/SybaseDS</datasource>
<datasource-mapping>Sybase</datasource-mapping>
</defaults>
</jbosscmp-jdbc>
Finally, we modify login-config.xml to use the Sybase database. Add the following <application-policy/> element to the file:
<application-policy name = "SybaseDbRealm">
<authentication>
<login-module code =
"org.jboss.resource.security.ConfiguredIdentityLoginModule"
flag = "required">
<module-option name ="principal">sa</module-option>
<module-option name = "userName">sa</module-option>
<module-option name = "password"></module-option>
<module-option name = "managedConnectionFactoryName">
jboss.jca:service=LocalTxCM,name=SybaseDS
</module-option>
</login-module>
</authentication>
</application-policy>
By modifying the sybase-ds.xml, standardjaws.xml, standardjbosscmp-jdbc.xml, and login-config.xml, the JBoss 4.0 server is configured to be used with a Sybase database.
DB2 Database Configuration
IBM's DB2 Universal Database is a full-featured, robust, scalable, and easy-to-use database server that may be used on Linux, UNIX, and Windows platforms.
We begin by adding its driver to the CLASSPATH:
copy db2java.zip to the /server/default/lib
directory. To configure the JBoss server with the DB2 data source, copy
/docs/examples/jca/db2-ds.xml to the
/server/default/deploy directory.
Next we modify the db2-ds.xml configuration file, by
setting <driver-class/>
to COM.ibm.db2.jdbc.app.DB2Driver and
<connection-url/> to
jdbc:db2:<database>, where
<database> is the DB2 database name.
Then we modify standardjaws.xml (or
jaws.xml) to set
<datasource> and <type-mapping>.
<jaws>
<datasource>java:/DB2DS</datasource>
<type-mapping>DB2</type-mapping>
</jaws>
And standardjbosscmp-jdbc.xml (or jbosscmp-jdbc.xml):
<jbosscmp-jdbc>
<defaults>
<datasource>java:/DB2DS</datasource>
<datasource-mapping>DB2</datasource-mapping>
</defaults>
</jbosscmp-jdbc>
Finally, we add the following <application-policy/> element to login-config.xml:
<application-policy name = "DB2DbRealm">
<authentication>
<login-module code =
"org.jboss.resource.security.ConfiguredIdentityLoginModule"
flag = "required">
<module-option name =
"principal">sa</module-option>
<module-option name =
"userName">sa</module-option>
<module-option name =
"password"></module-option>
<module-option name ="managedConnectionFactoryName">
jboss.jca:service=LocalTxCM,name=DB2DS
</module-option>
</login-module>
</authentication>
</application-policy>
These configuration changes allow us to use DB2 with JBoss.
Informix Database Configuration
IBM's Informix database servers are used for data warehousing,
analysis, and reporting. To use the JBoss 4.0 server with an Informix
database, we start by putting Informix's .jar into the
CLASSPATH: add
ifxjdbc.jar to the /server/default/lib directory.
Then configure the data source by copying
/docs/examples/jca/informix-ds.xml to the
/server/default/deploy directory. If you are using the
XA JDBC Informix driver, copy /docs/examples/jca/informix-xa-ds.xml instead.
Next we modify the informix-ds.xml configuration file by
setting the <driver-class/> to
com.informix.jdbc.IfxDriver and
<connection-url/> to
jdbc:informix-sqli://<host>:<port>:informixserver=<ifx_server>,
where <host> is the host server,
<port> is the Informix server port number, and
<ifx_server> is the Informix database name.
We set the <datasource> and
<type-mapping> elements in standardjaws.xml
or jaws.xml like this:
<jaws>
<datasource>java:/InformixDS</datasource>
<type-mapping>InformixDB</type-mapping>
</jaws>
We set the <datasource> and
<datasource-mapping> elements of
standardjbosscmp-jdbc.xml or jbosscmp-jdbc.xml like this:
<jbosscmp-jdbc>
<defaults>
<datasource>java:/InformixDS</datasource>
<datasource-mapping>InformixDB</datasource-mapping>
</defaults>
</jbosscmp-jdbc>
Finally, we add an <application-policy/> element to
login-config.xml:
<application-policy name = "InformixDbRealm">
<authentication>
<login-module code =
"org.jboss.resource.security.ConfiguredIdentityLoginModule"
flag = "required">
<module-option name = "principal">sa</module-option>
<module-option name = "userName">sa</module-option>
<module-option name = "password"></module-option>
<module-option name ="managedConnectionFactoryName">
jboss.jca:service=LocalTxCM,name=InformixDS
</module-option>
</login-module>
</authentication>
</application-policy>
These configuration changes allow us to use JBoss with an Informix database.
Conclusion
The JBoss 4.0 server is configured with the Hypersonic database by default, but as we've seen, it is a simple matter of changing a few configuration files to use any one of a number of popular databases.
Resource
Deepak Vohra is a NuBean consultant and a web developer.
Return to ONJava.com.
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 28 of 28.
-
JDBC Data source for Non-EJB clients
2008-03-04 05:03:25 RaviCKota [Reply | View]
-
JDBC Data source for Non-EJB clients
2008-03-04 09:22:14 Deepak Vohra [Reply | View]
If EJB is not used only mysql-ds.xml and login-config.xml are required to be modified.
-
Code Snippet for using the configured Datasource
2006-06-09 00:42:25 solarsiva [Reply | View]
After configuring the datasource for diffent datasource how do I connect to the configured datasource. I am new to Datasource reference and it would be great if some one can post the code snippet for the same.
regards,
Siva -
Code Snippet for using the configured Datasource
2006-06-09 07:24:12 Deepak Vohra [Reply | View]
InitialContext initialContext = new InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource) initialContext
.lookup("java:MySqlDS");
java.sql.Connection conn = ds.getConnection();
-
sql server connection with jdbc
2006-01-22 23:14:58 tedua [Reply | View]
hi,
i tried giving connection with sql server using jdbc . can you give me the url and driver for sql, also how should i find those path? -
sql server connection with jdbc
2006-01-23 13:50:10 Deepak Vohra [Reply | View]
Refer
http://www.oreillynet.com/cs/user/view/cs_msg/39468 -
sql server connection with jdbc
2006-01-23 13:49:29 Deepak Vohra [Reply | View]
URL:jdbc:microsoft:sqlserver://localhost:1433
Driver Class: com.microsoft.jdbc.sqlserver.SQLServerDriver
-
Configuring Jboss for MS Access Dtabase
2005-05-12 22:20:24 doubtman [Reply | View]
hi,
Can u tell me how to configure the jboss-cmp-jdbc.xml for Access database.
thanks -
Configuring Jboss for MS Access Dtabase
2005-05-14 05:55:34 Deepak Vohra [Reply | View]
To configure with the MS Access driver:
1. Copy the MS access jdbc-odbc driver jar file to theserver/default/libdirectory.
http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/bridge.doc.html
Copymsaccess-ds.xmlfrom/docs/examples/jcadirectory to
/server/default/deploydirectory.
In themsaccess-ds.xmlset theconnection-urltojdbc:odbc:<DSNNAME>.<DSNNAME>variable is the DSN name. Set theuser-nameandpassword.
In thestandardjbosscmp-jdbc.xmlset
<jbosscmp-jdbc>
<defaults>
<datasource>java:/MSAccessDS</datasource>
<datasource-mapping>MS ACCESS</datasource-mapping>
</defaults>
</jbosscmp-jdbc>
In thestandardjbosscmp-jdbc.xmladd a type-mapping for MS ACCESS.
In thelogin-config.xmladd a login configuration for MS ACCESS
<application-policy name = "MSACESSDbRealm">
<authentication>
<login-module code =
"org.jboss.resource.security.ConfiguredIdentityLoginModule"
flag = "required">
<module-option name = "principal"></module-option>
<module-option name = "userName"></module-option>
<module-option name = "password"></module-option>
<module-option name ="managedConnectionFactoryName">
jboss.jca:service=LocalTxCM,name=MSAccessDS
</module-option>
</login-module>
</authentication>
</application-policy>
-
Oracle Configuration
2005-02-16 06:26:27 Deepak Vohra [Reply | View]
In the Oracle Configuration section :
The<driver-class/>and<connection-url/>settings for Oracle are as follows:
Oracle OCI Type 2 Driver
Class: oracle.jdbc.driver.OracleDriver
URL: jdbc:oracle:oci:@<database>
Oracle Thin Type 4 Driver
Class: oracle.jdbc.driver.OracleDriver
URL: jdbc:oracle:thin:@<host>:<port>:<database>
Oracle OCI XA Type 2 Driver
Class: oracle.jdbc.xa.client.OracleXADataSource
URL:jdbc:oracle:oci:@<database>
Oracle Thin XA Type 4 Driver
Class: oracle.jdbc.xa.client.OracleXADataSource
URL: jdbc:oracle:thin:@<host>:<port>:<database>
-
JAWS
2004-12-06 02:09:19 PieterPareit [Reply | View]
Hi,
I have just bought the Oreilly Enterprise JavaBeans 4th edition. And there they don't speak about the JAWS.xml. I even readed the JBOSS 4.0 starters guide, and there they also didn't mentioned the JAWS.xml.
I setted up the JBoss 4.0, to work with CMP beans, I created one bean, but my bean still works with the Hypersonic DB, and I can't figure out why my bean doesn't work with my MySQL database. I have posted my code to the java.sun.com forum.
Ref. http://forum.java.sun.com/thread.jspa?threadID=577081&tstart=0
Pieter
-
JAWS
2004-12-06 05:30:36 Deepak Vohra [Reply | View]
The connection url for MySQL is jdbc:mysql://localhost/test
Also, has an application-policy been added to login-config.xml?
It is not necessary to set up JAWS if you are not using CMP 1.1 entity beans.
-
Which database is most prefarable with JBoss
2004-12-02 20:31:06 naveenHazari [Reply | View]
In my view MySQL is the Sutable one -
Which database is most prefarable with JBoss
2004-12-03 06:44:57 Deepak Vohra [Reply | View]
MySQL is an open source database, thus has an advantage over the commercial databases. PostgreSQL is another open source database.
-
getting JDBCHsqldbCreateCommand error in JBoss4.0
2004-10-20 04:54:50 SaurabhVyas [Reply | View]
I have created .ear file for my project and it runs nicely in JBoss3.2 but when i try to deploy the same .ear file in JBoss4.0 than it is giving me following error.I am unable to solve this error and require help. I would be thankful if someone helps me solve this problem as it is urgent.The error is shown below:
--------------------------------------------------
17:12:57,234 ERROR [EntityContainer] Starting failed jboss.j2ee:jndiName=ApplicationInfo,service=EJB
org.jboss.deployment.DeploymentException: Could not load class: org.jboss.ejb.plugins.cmp.jdbc.hsqldb.JDBCHsqldbCreateCommand
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityCommandMetaData.<init>(JDBCEntityCommandMetaData.java:112)
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityMetaData.<init>(JDBCEntityMetaData.java:906)
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.<init>(JDBCApplicationMetaData.java:363)
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXmlFileLoader.java:75)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaData(JDBCStoreManager.java:721)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:409)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:353)
at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:157)
at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:340)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)[B]EntityContainer[/B][B]org.jboss.deployment.DeploymentException[/B]
===============================================================
-
Method to configure JBoss-3.2.5 to use MySql and MS Sql database servers for two different web applications running on the same JBoss server
2004-10-11 07:55:02 comsite [Reply | View]
Hi,
I am using MySql 4.0 as the database for one of my web applications currently. I would like to know what additional steps should be followed to configure jboss 3.2.5 so that my current application continues to use MySql 4.0 and a new application would use MS SQL database server.
I hope my question is clear. Any comments or suggestions will be appreciated.
Awaiting an early reply to my post.
Thanks in advance.. -
Method to configure JBoss-3.2.5 to use MySql and MS Sql database servers for two different web applications running on the same JBoss server
2004-10-16 09:53:17 Deepak Vohra [Reply | View]
For configuration with MySQL please refer to the MySQL section.
For MS SQL Server refer to the reply to the post SQL Server 2000
-
SQL Server 2000
2004-03-10 12:19:58 razmaspaz [Reply | View]
Does anyone know how to configure for SQL Server 2000 using the ms jdbc driver? -
SQL Server 2000
2005-11-22 02:58:38 gamle01 [Reply | View]
Hi,
How should I configure 2 different datasources for MSSQL Server connection, in the same standardjbosscmp-jdbc.xml and other config files?
I've tried this but it doesn't work...
<defaults>
<datasource>java:/DEMODS</datasource>
<datasource>java:/DEMO2DS</datasource>
<datasource-mapping>MS SQLSERVER2000</datasource-mapping>
....
thanks in advance.
cheers,
g
-
SQL Server 2000
2005-11-22 07:29:04 Deepak Vohra [Reply | View]
The <defaults/> elements may have only one <datasource/> element. -
SQL Server 2000
2004-05-13 05:50:04 Deepak Vohra [Reply | View]
MS SQL Server Database Configuration
To configure JBoss 4.0 with MS SQL Server database, MS SQL Server driver classes are required in the Classpath.Copy MS SQL Server JDBC driver class jar filesmssqlserver.jar, msbase.jar, msutil.jarto theserver/default/libdir. To configure with non-xa MS SQL Server datasource copy/docs/examples/jca/mssql-ds.xmlto/server/default/deploydir. To configure with MS SQL Server XA datasource copy/docs/examples/jca/mssql-xa-ds.xmlto/server/default/deploydir. Modifymssql-ds.xmlconfiguration file. Driver Class and Connection URL settings for MS SQL Server JDBC Drivers
Driver Class:com.microsoft.jdbc.sqlserver.SQLServerDriver
Connection URL:jdbc:microsoft:sqlserver://localhost:1433;
DatabaseName=MyDatabase
To configure with XA JDBC driver for MS SQL Server modify the mssql-xa-ds.xml configuration file.
Driver Class:com.microsoft.jdbcx.sqlserver.SQLServerDataSource
The standardjaws.xml file is configured with Hypersonic database by default. To configure JBoss server with MS SQL Server database modify/server/default/conf/standardjaws.xmlconfiguration file. Set <datasource> and <type-mapping> elements.
<jaws>
<datasource>java:/MSSQLDS</datasource>
<type-mapping>MS SQLSERVER2000</type-mapping>
</jaws>
The standardjbosscmp-jdbc.xml configuration file is configured with Hypersonic database. To configure JBoss server with MS SQL Server modify /server/default/conf/standardjbosscmp-jdbc.xml configuration file. Set the <datasource> and <datasource-mapping> elements.
<jbosscmp-jdbc>
<defaults>
<datasource>java:/MSSQLDS</datasource>
<datasource-mapping>MS SQLSERVER2000</datasource-mapping>
</defaults>
</jbosscmp-jdbc>
Modify login-config.xml configuration file with MS SQL Server database settings. Add the following <application-policy/> element to login-config.xml.
<application-policy name = "MSSQLDbRealm">
<authentication>
<login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
<module-option name = "principal">sa</module-option>
<module-option name = "userName">sa</module-option>
<module-option name = "password"></module-option>
<module-option name ="managedConnectionFactoryName">
jboss.jca:service=LocalTxCM,name=MSSQLDS
</module-option>
</login-module>
</authentication>
</application-policy>
By modifying the mssql-ds.xml, standardjaws.xml, standardjbosscmp-jdbc.xml and login-config.xml the JBoss 4.0 server is configured to be used with a MS SQL Server database. -
SQL Server 2000
2004-10-11 02:46:18 HemantJoshi [Reply | View]
Dear Sir,
I have followed instructions given as above. I am still having problem using it with SQL Server 2000.
Could you possible email dummy files for SQL server 2000.
Much appreciated.
Kind Regards
Hemant
-
SQL Server 2000
2004-10-11 05:16:02 Deepak Vohra [Reply | View]
What is the configuration error you are getting? Please post detail.
thanks,
Deepak -
SQL Server 2000
2005-03-30 20:18:39 kalparser [Reply | View]
The Hibernat-service.xml is like this:
<server>
<mbean code="org.jboss.hibernate.jmx.Hibernate"
name="jboss.har:service=Hibernate">
<attribute name="DatasourceName">java:MSSQLDS</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.HSQLDialect</attribute>
<attribute name="SessionFactoryName">java:/hibernate/SessionFactory</attribute>
<attribute name="CacheProviderClass">
net.sf.hibernate.cache.HashtableCacheProvider
</attribute>
</mbean>
</server>
And I create the session from a session bean:
SessionFactory sf = (SessionFactory)ctx.lookup("java:/hibernate/SessionFactory");
I got exception as below:
javax.naming.NameNotFoundException: hibernate
not bound
Need help urgently!!
Thanks!
-
Jaws
2004-02-27 08:24:22 acoliver@jboss.org [Reply | View]
It is not necessary to set up JAWS if you are not using CMP 1.1 entity beans. It is likely that some of this will change when the final release of 4.0 comes out especially with the addition of Hibernate.
-
comprehensive
2004-02-27 00:25:26 naimdjon [Reply | View]
Can Jboss 3.2.x jdbc be configured the same way? -
comprehensive
2004-03-04 05:30:10 Deepak Vohra [Reply | View]
JBoss 3.2 JDBC conifuration is similar to JBoss 4.0





Thanks for sharing information on JDBC connectivity in JBoss. But please let me know, the descriptor files that are needed to create a simple JDBC application accessed by a stand alone java application which is neither based on Servlets nor ejbs.
I'm looking for the steps involved in mapping a JDBC Datasource to JNDI and accessing that through Context.
I use MySQL 5.0, JDK1.4 and JBoss 4.0
Thanks
Ravi