File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Struts-Database Connectivity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Struts-Database Connectivity" Watch "Struts-Database Connectivity" New topic

Struts-Database Connectivity

vikas malviya

Joined: Aug 06, 2009
Posts: 14
Hello everyone...

i am the beginner in struts and want to do the database connectivity with ms-sql,
i want to do the simple 4 operations Select,Insert,Update,Delete.

but i read that we can connect the database by using jndi,so please can anyone provide me the details about the struts-database connectivity with simple example,please also suggest me books for it.

Thanks in advance.

Vikas Malviya
David Newton

Joined: Sep 29, 2008
Posts: 12617

This doesn't really have anything to do with Struts. Moving to... JEE?
Ankit Garg

Joined: Aug 03, 2008
Posts: 9465

Database connectivity through JNDI is actually using a Connection Pool to the database. This connection pool is maintained by the container. Only the lookup of the database connection is different and rest of the code to do database operations is just like normal JDBC. You can get a lot of examples on this like here and here. This doesn't has much of a relation with Struts, you can use this even in applications that don't use Struts...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
I agree. Here's the link:
subject: Struts-Database Connectivity
It's not a secret anymore!