File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Defining Datasource in JBoss4.x

 
Anand Bhatt
Ranch Hand
Posts: 189
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
In which file in JBoss can I define my own datasource for MySQl database,and what varions properties I have set?
 
Patricia Samuel
Ranch Hand
Posts: 300
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<?xml version="1.0" encoding="UTF-8"?>

<!-- ===================================================================== -->
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- ===================================================================== -->

<!-- ==================================================================== -->
<!-- Datasource config to be copied in Location where to keep this file jboss-4.0.4.GA\server\default\deploy -->
<!-- ==================================================================== -->


<datasources>
<local-tx-datasource>
<jndi-name>jdbc/testDS</jndi-name>
<connection-url>jdbc racle:thin:@url:1521:schema</connection-url>
<driver-class>driver class - jdbc.</driver-class>
<user-name>user</user-name>
<password>password</password>
<!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
<!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
<!-- Checks the Oracle error codes and messages for fatal errors -->
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>

</local-tx-datasource>

</datasources>



Name this file after the name of your project. Like if your project name is test then name it like testDS.
and keep this file under location - \jboss-4.0.4.GA\server\default\deploy

Hope this would help. If you face any problem, kindly post a comment.
[ October 27, 2008: Message edited by: Patricia Samuel ]
 
Anand Bhatt
Ranch Hand
Posts: 189
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for early reply,but where can i find this datasource config file and what is the name of that file to be copied?
Thanks
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See these wiki articles:

Config DataSources

-ds.xml

You can find example datasource files in %JBOSS_HOME%\docs\examples\jca folder.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic