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...