| Author |
How to configure hsqldb in struts 1.3.8?
|
Raghu ram
Ranch Hand
Joined: Oct 19, 2007
Posts: 34
|
|
Hello frnds, Anybody please help me. Am using Hypersonic sql database(that is HSQLDB) and struts 1.3.8 version am using.Anybody tell me to configure database in struts. Reply me soon
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
There is nothing unique about using a database in a Struts application. The best practice is to configure a JNDI Data Source in your Application Server that points to your database and then use a JNDI lookup in your application code to find the Data Source and use it to establish a connection to the database. You would then use standard JDBC code to access the tables. Earlier versions of Struts allowed you to configure an Apache Commons Data Source within the Struts config file. The authors of Struts, however, realized this was not a good idea, and they removed it from the latest versions of Struts. [ March 05, 2008: Message edited by: Merrill Higginson ]
|
Merrill
Consultant, Sima Solutions
|
 |
Raghu ram
Ranch Hand
Joined: Oct 19, 2007
Posts: 34
|
|
Hi Merrill Higginson, Can you give me the code to get the datasource. Please reply me soon dude.
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
For information on how to use JNDI data sources in a J2EE application, see Chapter 31 of the Sun J2EE Tutorail. Basically, the code looks like this:
|
 |
 |
|
|
subject: How to configure hsqldb in struts 1.3.8?
|
|
|