I was wondering how one would go about using sqlite3 to validate users in tomcat6. I do not have permission to install any sql type services, so I have to depend on sqlite3. My hope was to add this as a wrapper to an already existing deployment to provide better user management.
I have a users.db
(tables: users(username,password)
, roles(username,role)
) file sitting right next to tomcat-users.xml
in /etc/tomcat6
. I tried (unsuccessfully) to edit server.xml
with this:
<Resource name="UserDatabase" auth="Container"
type="javax.sql.DataSource"
description="User database that can be updated and saved"
driverClassName="org.sqlite.JDBC"
pathname="conf/log.db" />
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
Additionally, I got a JDBC driver sqlitejdbc-v056.jar
for sqlite3 from http://www.zentus.com/sqlitejdbc/ and placed it in CATALINA_HOME
(it is specifically at /usr/share/tomcat6/lib/sqlitejdbc-v056.jar
).
Any help would be greatly appreciated from this frustrated Tomcat noobie. Thank you.