Skip to main content

Access to MySql Database in the Web Service

1 reply [Last post]
erenavsarogullari
Offline
Joined: 2006-09-20

Hi all,

In my j2me web service project, i want to access to MySql database in the web service and

my installation is

Tomcat 5.0 for Java WSDP,
Java Web Services Developer Pack 1.5,
MySql Server 5.0 and environment variables are adjusted...

server.xml where is in "C:\tomcat50-jwsdp\conf" is adjusted like this

but i have not access to MySql database in the web service yet...

please help...

Eren Av?aro?ullar?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
chearius
Offline
Joined: 2006-10-06

Hi Eren,

if you want to access MySQL database from your WebService you definitely don't need to define a new realm in the Tomcat configuration (server.xml). You can either instantiate a database connection directly in the WS by using JDBC API (i.e. via java.sql.Connection) class or you can specify a new JNDI resource in Tomcat configuration (see http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html part JDBC DataSources).

Marek