Hi,

If you're looking for simplicity, I'd suggest you go for sql2java
(sourceforge). It's absolutely independent and automatic. In a few words,
it's a class generator. It analyzes your database and automatically
generates the DAO classes (the Java source, and even the javadocs) for it,
including the DAO Manager. Then, when using the classes, you may initialize
the DAO Manager at your free will, i.e. it doesn't use any config file. You
provide the connection parameters or the DataSource to be used.

HTH.

Freddy

-----Mensaje original-----
De: Philippe PONSONNET [mailto:[EMAIL PROTECTED]
Enviado el: sábado, 04 de diciembre de 2004 14:02
Para: Struts Users Mailing List
Asunto: Re: Access to a database with a configuration file


I have already seen the hibernate framework but I
prefere to not use an OR for beginning. I would like
to   only use my very simple Database class. I suppose
it is possible to load this xml file by by a specific
way, isnt-it ?


 --- Vic <[EMAIL PROTECTED]> a écrit :
> Consider reading iBatis Sturts jPetStore on DAO or
> Rick Reumans Struts
> How to DAO tutorial.
> (DAO = Data Base Access)
> .V
>
> Philippe PONSONNET wrote:
> > This solution seems to be not possible because my
> > Database class is not a Servlet but a classic
> class.
> > Is it possible to load my resource Database.xml
> with
> > the web.xml descriptor file ?
> >
> > And how could I load it with my Database class ?
> >
> > Thanks
> >
> >
> >
> >  --- Niall Pemberton
> > <[EMAIL PROTECTED]> a écrit :
> >
> >>You could use the ServletContext's
> >>getInputStream("fileName") method
> >>
> >>Niall
> >>
> >>----- Original Message -----
> >>From: "Philippe PONSONNET" <[EMAIL PROTECTED]>
> >>To: <[EMAIL PROTECTED]>
> >>Sent: Saturday, December 04, 2004 12:35 AM
> >>Subject: Access to a database with a configuration
> >>file
> >>
> >>
> >>
> >>>Hello,
> >>>
> >>>
> >>>
> >>>I would like to use a database with struts
> without
> >>
> >>using the default
> >>
> >>>datasource.
> >>>
> >>>I also would like to configure all acces of this
> >>
> >>database with a xml file
> >>
> >>>named database.xml.
> >>>
> >>>The goal of this is to have a really independant
> >>
> >>model.
> >>
> >>>
> >>>
> >>>So I have developped a special class named
> >>
> >>Database which uses the
> >>
> >>>database.xml file for its connection.
> >>>
> >>>All my classes which map a table use this class.
> >>
> >>Like that, it is not
> >>
> >>>nessecary to add some code in my action classes
> to
> >>
> >>connect the database.
> >>
> >>>
> >>>
> >>>But I have a problem when I want to load the
> >>
> >>database.xml file : I can't
> >>get
> >>
> >>>its path when my webapp is loaded.
> >>>
> >>>The instruction
> >>
> >>getClass().getResource(".").getFile() always
> return
> >>null.
> >>
> >>>
> >>>
> >>>How could I do ?
> >>>
> >>>
> >>>
> >>>Thanks in advance and sorry for my poor english.
> >>>
> >>>
> >>>
> >>>Philippe
> >>>
> >>>
> >>
> >>
> >>
> >>
> >
>
---------------------------------------------------------------------
> >
> >>To unsubscribe, e-mail:
> >>[EMAIL PROTECTED]
> >>For additional commands, e-mail:
> >>[EMAIL PROTECTED]
> >>
> >>
> >
> >
> >
> >
> >
> >
> >
> > Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace
> de stockage pour vos mails !
> > Créez votre Yahoo! Mail sur
> http://fr.mail.yahoo.com/
> >
> > Avec Yahoo! faites un don et soutenez le Téléthon
> en cliquant sur
> http://www.telethon.fr/030-Don/10-10_Don.asp
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>






Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos
mails !
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/

Avec Yahoo! faites un don et soutenez le Téléthon en cliquant sur
http://www.telethon.fr/030-Don/10-10_Don.asp

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to