ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Lamey <cla...@localmatters.com>
Subject Re: Setting up user id, password for JDBC connection
Date Wed, 21 Nov 2007 21:26:08 GMT
Try creating a properties object, setting the name/value pairs on that, and
passing that into:

    public static SqlMapClient buildSqlMapClient(java.io.Reader reader,
java.util.Properties props)

Cheers,
Chris

On 11/21/07 2:15 PM, "Ashish Kulkarni" <ashish.kulkarni13@gmail.com> wrote:

> Hi
> I am working on a swing application where the user enters his user id and
> password, then this user id and password is required to create SqlMapClient,
> this is what i am tried but did not work
> in my sqlconfig.xml file i have
> <dataSource type="SIMPLE">
> <property name="JDBC.Driver" value="${driver}" />
> <property name="JDBC.ConnectionURL" value="${url}" />
> <property name="JDBC.Username" value="${username}" />
> <property name="JDBC.Password" value="${password}" />
> </dataSource>
> 
> And in my java program
> I do
> System.setProperty("driver", JDBCdrivername);
> System.setProperty("url", url);
> System.setProperty("username", username);
> System.setProperty("password", password);
> 
> String resource = "com/pfizer/maps/sqlmap/sql/SQLMapConfigAS400.xml";
> Reader reader = Resources.getResourceAsReader(resource);
> SqlMapClient sqlMapClient = SqlMapClientBuilder.buildSqlMapClient(reader);
> 
> Any ideas of how do i get it working in Swing application
> 
> Ashish


Mime
View raw message