kevin948
kevin948

Reputation: 648

tomcat6 sqlite3 user authentication

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.

Upvotes: 1

Views: 517

Answers (1)

palacsint
palacsint

Reputation: 28865

No, you don't have to depend on sqlite3. You could use HSQLDB which was written in Java and does not require any platform specific binaries. Another candidate is Apache Derby and maybe there are some others.

Upvotes: 1

Related Questions