File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes JBoss and MySQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss and MySQL" Watch "JBoss and MySQL" New topic
Author

JBoss and MySQL

Saman Perera
Ranch Hand

Joined: Jul 15, 2003
Posts: 61
Hi All

Please expain to me how to configure MySql and JBoss to start an J2ee project my prefered IDE is Eclipse ,please help me

Thanking you
Saman
SCJP 1.4
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

You need to create a DataSource for your MysQL database. Look in the examples folder of JBoss (docs/examples/jca) there are a whole bunch of sample DataSource files. Just copy mysql-ds.xml (changing the relevant bits obviously), put it in your deploy directory, check you have the required Driver in your JBoss classpath and start the server.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Saman Perera
Ranch Hand

Joined: Jul 15, 2003
Posts: 61
thanks you Paul Sturrock your instruction

any on can give me a web link or tutorial on this topic

Saman
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

http://www.coderanch.com/t/89165/JBoss/JCA-JBOSS-Change-default-Hypersonic


Groovy
norman richards
Author
Ranch Hand

Joined: Jul 21, 2003
Posts: 367
I can recommend a book that shows how to do it...

There's really not much more to it than that. Put the driver in server/default/lib. Copy mysql-ds.xml into your deploy directory. Edit the hostname/databasename/username/password values. That's it.
Dave Salter
Ranch Hand

Joined: Jul 20, 2005
Posts: 292

The one thing that caught me out when I first started to use JBoss was that to deploy a datasource, the name of the XML file that deploys the datasource must end in -ds.xml

I didn't find anywhere that made this clear when I was starting out.
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Document for you ::

Eclipse IDE for J2EE 1.3 Development
(Tomcat 4.x, JBoss 3.x, MySQL 3.x)


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by norman richards:
Put the driver in server/default/lib. Copy mysql-ds.xml into your deploy directory. Edit the hostname/databasename/username/password values. That's it.

Umm. I've done this exact sequence once for a J2EE training where we used JBoss and MyEclipseIDE. However, I would feel better if there would be a way to include the datasource definition as part of the application itself. Is there such a way?

Again, the ideal in my opinion would be that whatever needs to be done to a plain vanilla installation of the application server could be done inside the .ear file -- a bit like the Context XML for Tomcat web applications.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
norman richards
Author
Ranch Hand

Joined: Jul 21, 2003
Posts: 367
Sure, this is possible. Put your-ds.xml inside your ear, and create a jboss-app.xml that looks like this:

Siripa Siangklom
Ranch Hand

Joined: Jan 26, 2004
Posts: 79
Hi,

This is a tutorial how to set CMP in MySQL and JBoss.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JBoss and MySQL