7 messages in com.mysql.lists.javaRe: ejb to mysql
FromSent OnAttachments
bau...@michaelbauer.com21 Aug 2002 15:31 
David Parker22 Aug 2002 06:21 
Peter T. Abplanalp22 Aug 2002 07:41 
Matt McNichols22 Aug 2002 08:18 
bau...@michaelbauer.com22 Aug 2002 19:58 
Peter T. Abplanalp23 Aug 2002 02:11 
bau...@michaelbauer.com23 Aug 2002 13:28 
Subject:Re: ejb to mysql
From:Matt McNichols (ma@mattkelli.com)
Date:08/22/2002 08:18:26 AM
List:com.mysql.lists.java

There is athread in the JBoss forums that may help http://www.jboss.org/forums/thread.jsp?forum=46&thread=7827&message=380365&q =mysql#380365

Sorry, I neglected to copy my original reply to the list....

I believe the place to define DataSources is in the jboss.jcml file, but I have not even gotten that far myself, so perhaps a JBoss expert out there can help.

- DAP

-----Original Message----- From: bau@michaelbauer.com [mailto:bau@michaelbauer.com] Sent: Thursday, August 22, 2002 1:24 AM To: David Parker Subject: RE: ejb to mysql

I think that's the case - I don't have the datasource defined properly in jboss. Can somebody help us out here? I think we need to dfine someting in jboss.xml and maybe ejb-jar.xml. I think translating ancient Sumerian is easier than configuring this silly stuff. I just want to an ejb to talk a regular old mysql database.

On Wed, 21 Aug 2002, David Parker wrote:

Is an Exception being thrown by that code? It would be helpful to know what it is, if so. For testing purposes you could just throw a "e.printStackTrace()" call in there. If you are just not getting the DataSource back (e.g., you are getting null), then it could be that you do not have the DataSource defined properly in JBoss. I just started with JBoss myself, so I'm afraid I don't know where that needs to be done!

- DAP

-----Original Message----- From: bau@michaelbauer.com [mailto:bau@michaelbauer.com] Sent: Wednesday, August 21, 2002 6:31 PM To: ja@lists.mysql.com Subject: ejb to mysql

Hi. I don't know a lot about Java but am learning. I'm trying to resurrect an old JSP/Javabeans/EJB application. I kind of have it working. I'm able to connect from the JSP/Javabeans side but am having trouble connecting from the EJB side. Both have the exact same code in the initialization sections. Here's the code from the EJB side:

public void ejbCreate() throws CreateException { try { Context ictx = new InitialContext(); dataSource = (DataSource) ictx.lookup("indiro"); } catch (Exception e) { System.out.println("Could not link to the database,: " + e); } }

I'm a little unclear as how this whole thing works. I thought I put the right things into jboss.xml and the latest mysql driver in the right place. Please help.

--

--------------------------------------------------------------

------------ Michael Bauer bau@michaelbauer.com http://www.michaelbauer.com

---------------------------------------------------------------------

Please check "http://www.mysql.com/Manual_chapter/manual_to> c.html" before posting. To request this thread, e-mail java@lists.mysql.com

To unsubscribe, send a message to the address shown in the List-Unsubscribe header of this message. If you cannot see it, e-mail java@lists.mysql.com instead.

--

--------------------------------------------------------------------------

Michael Bauer bau@michaelbauer.com http://www.michaelbauer.com

To unsubscribe, send a message to the address shown in the List-Unsubscribe header of this message. If you cannot see it, e-mail java@lists.mysql.com instead.