ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Meadors" <lmead...@apache.org>
Subject Re: Setting up user id, password for JDBC connection
Date Mon, 26 Nov 2007 20:18:53 GMT
You have the property names wrong.

${driver} means the property should be "driver", not "JDBC.Driver".

Larry


On Nov 26, 2007 12:35 PM, Ashish Kulkarni <ashish.kulkarni13@gmail.com> wrote:
> Hi
> I tried the following but getting error, any ideas
>
> Properties prop = new Properties();
>  prop.put("JDBC.Driver", "com.ibm.as400.access.AS400JDBCDriver");
>  prop.put("JDBC.Username ", user);
>  prop.put("JDBC.Password", password);
>  prop.put("JDBC.ConnectionURL",
> "jdbc:as400:"+as400Name+"/"+library+";naming=system;date format=iso;time
> format=hms;prompt=false");
>
>
> String resource = "com/pfizer/maps/sqlmap/sql/SQLMapConfigAS400.xml";
>  Reader reader = Resources.getResourceAsReader(resource);
>  sqlMapClient = SqlMapClientBuilder.buildSqlMapClient(reader, prop);
>
> and in my SQLMapConfigAS400.xml i have
> <transactionManager type="JDBC">
>
>
>  <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>
>  </transactionManager>
>
> It gives me error, does anyone one have any example for get it working
>
> Ashish
>
>
>
>
>
>
>
> On 11/21/07, Christopher Lamey <clamey@localmatters.com> wrote:
> > 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