ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Wilson <mw9...@yahoo.com>
Subject DaoConfig questions please
Date Thu, 23 Mar 2006 18:11:34 GMT
  We are trying to connect to a physical database and running JPetStore 5 on Tomcat 4.0.2.
For our DaoConfig file, we have three questions:
  First, will it work to set the connection using the SimpleDataSource like this:
  DataSource dataSource = new SimpleDataSource(props);          
  conn = dataSource.getConnection();
  Second, we know we won't need this now (this worked great btw), but is there something we
need to do for the physical connection in place of this, or nothing at all?:
  //            ScriptRunner runner = new ScriptRunner(conn, false, false);
//            runner.setErrorLogWriter(null);
//            runner.setLogWriter(null);
//            runner.runScript(Resources.getResourceAsReader("ddl/hssql/jpetstore-hssql-schema.sql"));
//            runner.runScript(Resources.getResourceAsReader("ddl/hssql/jpetstore-hssql-dataload.sql"));
  Third, for the DaoManager method, we're not sure what Resources method we would use in place
of the getResourceAsReader which is grabbing the resource and passing to the Reader, or would
we still use this?:
  public static DaoManager newDaoManager(Properties props) {
    try {
      Reader reader = Resources.getResourceAsReader(resource);
      return DaoManagerBuilder.buildDaoManager(reader, props);
    } catch (Exception e) {
      throw new RuntimeException("Could not initialize DaoConfig.  Cause: " + e, e);
  This is a great product and we have it so it's building properly with the JUnit tests and
so forth. If we can get past this one stumbling block (which has had us stumped over a day
now) it will be something we can use in production and a great learning tool for a couple
of our developers. Any help would really be greatly appreciated.
  Thank you all in advance,

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
View raw message