File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JBoss/WildFly and the fly likes Defining Datasource in JBoss4.x Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Defining Datasource in JBoss4.x" Watch "Defining Datasource in JBoss4.x" New topic

Defining Datasource in JBoss4.x

Anand Bhatt
Ranch Hand

Joined: May 30, 2007
Posts: 189
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

Joined: Sep 12, 2007
Posts: 300
<?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 -->
<!-- ==================================================================== -->

<connection-url>jdbc racle:thin:@url:1521:schema</connection-url>
<driver-class>driver class - jdbc.</driver-class>
<!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
<!-- Checks the Oracle error codes and messages for fatal errors -->
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>



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

Joined: May 30, 2007
Posts: 189
Thanks for early reply,but where can i find this datasource config file and what is the name of that file to be copied?
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

See these wiki articles:

Config DataSources


You can find example datasource files in %JBOSS_HOME%\docs\examples\jca folder.

[My Blog] [JavaRanch Journal]
I agree. Here's the link:
subject: Defining Datasource in JBoss4.x
jQuery in Action, 3rd edition