Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Simple WAR with JDBC access
Simple WAR with JDBC access [message #735617] Wed, 12 October 2011 11:56 Go to next message
Thomas Jones is currently offline Thomas JonesFriend
Messages: 2
Registered: October 2011
Junior Member
I'm having trouble finding documentation on how to setup a Datasource in Virgo, such that a simple WAR file with servlets can access the Datasource. This works fine in Tomcat and JBoss, but I'm having problems getting it to work in Virgo.


In Tomcat, all I need is this definition in the context.xml file:

<Resource name="jdbc/MyDataSource" auth="Container" type="javax.sql.DataSource"
maxActive="70" maxIdle="30" maxWait="10000"
username="********" password="********" driverClassName="com.ibm.db2.jcc.DB2Driver"
url="jdbc:db2://********:50000/MYDB"/>



Any my web.xml has a matching resource_ref:

<resource-ref id="ResourceRef_1">
<res-ref-name>jdbc/MyDataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>




Is there any feedback on getting this working in Virgo?
Re: Simple WAR with JDBC access [message #735626 is a reply to message #735617] Wed, 12 October 2011 12:26 Go to previous messageGo to next message
Thomas Jones is currently offline Thomas JonesFriend
Messages: 2
Registered: October 2011
Junior Member
Also, in my servlet I'm simply looking up the datasource like this:

datasource = (DataSource) context.lookup("java:comp/env/jdbc/MyDataSource";);
Re: Simple WAR with JDBC access [message #735778 is a reply to message #735626] Wed, 12 October 2011 17:22 Go to previous message
Violeta Georgieva is currently offline Violeta GeorgievaFriend
Messages: 278
Registered: October 2010
Senior Member
Hi,

You do not specify what the problem is, but may be this forum topic will be helpful: http://www.eclipse.org/forums/index.php/m/715766/

Regards
Violeta
Previous Topic:Upgrading to Virgo 3.0.1 causing Uses violations
Next Topic:JNLP on Virgo Web Server
Goto Forum:
  


Current Time: Fri Mar 29 12:37:03 GMT 2024

Powered by FUDForum. Page generated in 0.02091 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top