Thanks!

2011/8/18 <[email protected]>

> The property names are correct. The only problem is
> that org.Postgresql.Driver does not implement javax.sql.DataSource. Use the
> documentation to choose an appropriate class:
> http://jdbc.postgresql.org/documentation/publicapi/org/postgresql/ds/package-summary.html
>
>
> On Thu, Aug 18, 2011 at 1:22 PM, Phil Steitz - [email protected]
>  wrote:
>
> On 8/16/11 2:43 PM, Fabricio Pizzichillo wrote:
>> > Hi Les,
>> > I follow some docs, and write this in shiro.ini
>> >
>> >
>> > *[main]*
>> > *jdbcRealm* = org.apache.*shiro*.realm.jdbc.*JdbcRealm*
>> > *jdbcRealm*.authenticationQuery = "SELECT password FROM users WHERE
>> > user_name = ?"
>> > ds = org.Postgresql.Driver
>> > ds.serverName = IP
>> > ds.user = user
>> > ds.password = pass
>> > ds.databaseName = DATABASE
>> > jdbcRealm.dataSource = $ds
>> >
>> > But ds.serverName does not exist.
>> > I have to change anything?
>>
>> Yes.  Those property names are for a MySQL JDBC datasource.
>> Consult the documentation for the postgres JDBC driver that you are
>> using. Use a DataSource for ds (i.e. a postgres DataSource
>> implementation or a connection pool).  Then look at the properties
>> exposed by the DataSource implementation and define these using the
>> ds.xxx properties above.
>>
>>
>> Phil
>> > Thanks
>> >
>> > 2011/8/16 Les Hazlewood <[email protected]>
>> >
>> >> Hi Fabricio,
>> >>
>> >> Look at the JdbcRealm's implementation here:
>> >>
>> >>
>> >>
>> http://svn.apache.org/repos/asf/shiro/trunk/core/src/main/java/org/apache/shiro/realm/jdbc/JdbcRealm.java
>> >>
>> >> and notice the *_QUERY constants.  For testing, you can make your
>> >> tables structured so that the queries will work for you.  But mostly
>> >> they are there as a default and to give you ideas.
>> >>
>> >> Usually, you will create database tables as necessary and call the
>> >> set*Query(String query) methods to match your database schema.
>> >>
>> >> HTH,
>> >>
>> >> --
>> >> Les Hazlewood
>> >> CTO, Katasoft | http://www.katasoft.com | 888.391.5282
>> >> twitter: @lhazlewood | http://twitter.com/lhazlewood
>> >> katasoft blog: http://www.katasoft.com/blogs/lhazlewood
>> >> personal blog: http://leshazlewood.com
>> >>
>>
>>
>>
>

Reply via email to