> I am learning struts, and I want to connect Access 2000 with struts
> application (simple), does anybody tell me where I can get good example
for
> connect to any DB (Access, SQL Server ,Oracle, whatever) with struts? (pls
> give me the links)
You don't connect to a database with Struts. Once you figure out how to
connect to your database, you might use that code within your Action, but
that code doesn't have anything to do with Struts.
In my case, I've implemented the J2EE Data Access Object pattern and I use
code like this:
ProfileView profileView =
(ProfileView) session.getAttribute( "profileView" );
if ( profileView == null ) {
DAOFactory udFactory = DAOFactory.getDAOFactory();
ProfileViewDAO profileViewDAO = udFactory.getProfileViewDAO();
profileView = profileViewDAO.read( profileKey );
}
All of the details about what kind of database I'm connecting to, the user
name, password, etc., are encapsulated in the DAO layer.
Now, this might be WAY overkill for your project, and you might put JDBC
code right into your Actions with no ill effects.
I haven't heard good things about communicating with Access using Java, but
perhaps things have improved. I've never tried it. If you need a small
database to play with, I've used HyperSonic SQL in school projects with
great success. Installation involves adding a .jar file to your classpath,
and then you can use JDBC to communicate with it. You can find it on
SourceForge.
HTH! Try the comp.lang.java.databases newsgroup if you need help getting up
and running with JDBC.
--
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management