ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc.Heim...@prolifics.de
Subject Re: Fwd: Dynamically specify the connectionURL in buildDaoManager
Date Thu, 26 Apr 2007 07:46:00 GMT
Works very fine for us.

In our sql-map.xml we have an entry like
      <property value="${url}" name="JDBC.ConnectionURL"/>
and pass in a Property-Object with a key named "url" ("connectionURL" in 
your case) and the desired connection url that is build at runtime.

HTH
Marc Heimann
Software Engineer

Prolifics Deutschland GmbH
Notkestr. 3, D-22607 Hamburg
phone +49 (0)40 890 667-70
fax    +49 (0)40 890 667-99
marc.heimann@prolifics.de
SOA... Building the Future into Your Business
Handelsregister: Hamburg, HRB 89903
Geschäftsführer: Ulrich Frotscher


"Forest Zhu" <forzhu@gmail.com> wrote on 26.04.2007 04:39:53:

> Hi, all.
> 
> My project consists of several database with the same schema, due to
> the business reason we could not specify which database should 
> connect in the sqlmapconfig.xml. So we have to specify the 
> connectionURL on the fly, like 
> 
>             Properties p = new Properties();
>             p.put("username", "username");
>             p.put("password", "password");
>             p.put("connectionURL", "xxxxxxx"); 
> 
>             DaoManager daom = DaoManagerBuilder.buildDaoManager(reader, 
p);
> 
> 
> But this does not work. From the previous discussions on similar 
> topic, it seems that dynamically setting the username and password 
> using the above method works. What about the connectionURL then? 
> 
> Thanks and best regards.
> 
> F.
Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message