You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by KonradZuse <Th...@hotmail.com> on 2014/08/26 05:50:35 UTC

Questions on how to connect to a MySQL DB using JDBCRealm

Hello all,

First I want to say that there is no real examples in the docs, and I have
found external examples to partially help me.

https://github.com/pires/simple-shiro-web-app/blob/master/src/main/webapp/WEB-INF/shiro.ini

This shows connecting up but doesn't show an actual url or login
credentials?  I notice it uses "JNDI"

But if you look here.

https://github.com/pires/simple-shiro-web-app/commit/dce2578cb658d2ec05c597b29c0617b2ac5f6023

You can see there was once a datasource 

-ds = com.jolbox.bonecp.BoneCPDataSource
-ds.driverClass=com.mysql.jdbc.Driver
-ds.jdbcUrl=jdbc:mysql://localhost:3306/simple_shiro_web_app
-ds.username = root
-ds.password = 123qwe
+ds = org.apache.shiro.jndi.JndiObjectFactory
+ds.resourceName = jdbc/myDS
+ds.requiredType = javax.sql.DataSource

So it seems I could use the code that has been removed, but I'm curious what
the ds =  com.jolbox.bonecp.BoneCPDataSource is about?  Are we supposed to
create our own class, or what?

I'm confused on what exactly we are supposed to do, but it seems I am
getting closer.

I will do this and the password matchers, as well as the hasher/salt and I
think that is all that I need... Right?

Also, I am currently working with another application that also needs to
login using the same credentials.  I am curious if we just create the same
algorithm and implement it, or will that not work?

I can possibly create the program myself, but it seems this would be the
faster way, but less preferred IMO as I think it should all be done using
the proper methods of hashing.



--
View this message in context: http://shiro-user.582556.n2.nabble.com/Questions-on-how-to-connect-to-a-MySQL-DB-using-JDBCRealm-tp7580166.html
Sent from the Shiro User mailing list archive at Nabble.com.