This question is better suited for the commons-user mailing list. Here's a typical JDBC usage:
Map mappers = new HashMap(); mappers.put("testMapper","org.apache.commons.mapper.TestMapper"); MapperFactory factory = new MapperFactory(mappers); DataSource ds = // get DataSource here JdbcMapperFactoryListener jdbcListener = new JdbcMapperFactoryListener(ds); factory.addMapperFactoryListener(jdbcListener); // All code up to this point would be done once at app. startup, this code // would be run when you want to persist a new object Mapper mapper = factory.getMapper("testMapper"); mapper.create(persistThisObject); David --- Yansheng Lin <[EMAIL PROTECTED]> wrote: > I don't quite understand the data access part of the Mapper project. > How do you > initialize a new Jdbc connection? Shouldn't there be a JdbcFactory > class > similar to MapperFactory class, where you could pass the connection > properties? > > + public JdbcFactoryTest(String, java.util.Properties) { > + } > > similar to the following test: > > public MapperFactoryTest(String name) { > super(name); > > this.mappers.put("testMapper", > "org.apache.commons.mapper.TestMapper"); > this.mappers.put( > "java.util.ArrayList", > "org.apache.commons.mapper.TestMapper"); > } > > > -----Original Message----- > From: David Graham [mailto:[EMAIL PROTECTED] > Sent: July 7, 2003 10:24 AM > To: Struts Users Mailing List > Subject: Re: generic SQL implementation > > > Mapper doesn't have a real website yet but you can view the source > online > at: > http://cvs.apache.org/viewcvs.cgi/jakarta-commons-sandbox/mapper/ > > You could also check it out of the cvs repository. > > David > > --- Vinay <[EMAIL PROTECTED]> wrote: > > David, > > > > Can you give me the URL for the mapper, this might be the one I am > > looking > > for ,even though I wanted to implement the API on my own. > > > > Thanks a lot > > VInay > > ----- Original Message ----- > > From: "David Graham" <[EMAIL PROTECTED]> > > To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > > Sent: Monday, July 07, 2003 11:35 AM > > Subject: Re: generic SQL implementation > > > > > > > There is a Mapper project in the commons sandbox that might help > you. > > It > > > allows you to store SQL in a properties file to remove it from your > > code. > > > Also, it acts as a layer between your app and your persistence > > technology > > > so you can swap in an O/R mapping tool, EJBs, etc if you decide > > against > > > using JDBC in the future. It also, makes using JDBC a breeze and > > removes > > > much error prone and repetitive code from your app. > > > > > > David > > > > > > > > > --- Vinay <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > Has anybody implemented a generic implementation for querying > > databases > > > > during runtime. I am using DAO's for data access layer. But I > want > > to > > > > furthur move the database logic to down one more layer of > > abstraction.I > > > > am dealing with different kinds of database (eg. let's say a > MySQL, > > MS > > > > Access and another not SQL at all ,index sequential files). I want > > the > > > > DAO to access the database during runtime. So I want my DAO to be > > > > independent of the SQL statements.The Database Interfrace would > talk > > to > > > > either MySQL,or Oracle or any other database.So that there is no > > need > > > > to have DAO for each database syntax, rather , this should be > > handled > > > > by a API thru an interface. > > > > > > > > Here's and examples > > > > > > > > Let's say for select statement , we supply table name, column > names, > > > > where cluase , and's etc > > > > > > > > The following method should handle the query > > > > > > > > List getSelect(String tablename, List columnnames, List > > Orderby,.....) > > > > etc { > > > > > > > > > > > > return queryresult > > > > } > > > > > > > > > > > > Any ideas appreciated > > > > Thank you > > > > Vinay > > > > > > > > > __________________________________ > > > Do you Yahoo!? > > > SBC Yahoo! DSL - Now only $29.95 per month! > > > http://sbc.yahoo.com > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > __________________________________ > Do you Yahoo!? > SBC Yahoo! DSL - Now only $29.95 per month! > http://sbc.yahoo.com > > --------------------------------------------------------------------- > 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] > __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]