Database Support | ![]() |
by Rana Bhattacharyya
Overview
DbUserManager is a JDBC based user manager. You would use this module if you have your username, password and other informations in a JDBC accessible database.
This user manager has been tested using Oracle 8i and mySQL server. All the user informations are stored in FTP_USER table. The SQL file is ftp-db.sql.
| Name | Datatype |
|---|---|
| LOGIN_ID | VARCHAR(64), Primary key |
| PASSWORD | VARCHAR(64) |
| HOME_DIR | VARCHAR(128) |
| ENABLED | VARCHAR(8) |
| WRITE_PERM | VARCHAR(8) |
| IDLE_TIME | INT |
| UPLOAD_RATE | INT |
| DOWNLOAD_RATE | INT |
Configurations
ftp-assembly.xml
The first step is to make sure that we are using the right user manager implementation. The fully qualified name of the LDAP based user manager is org.apache.ftpserver.DbUserManager. So we have to use this class name in ftp-assembly.xml file. The user-manager block should be:
<!-- user manager block -->
<block class="org.apache.ftpserver.usermanager.DbUserManager" name="user-manager"/>
ftp-config.xml
The next step is to use appropriate configuration parameters. So we have to modify ftp-config.xml file. The sample block is for MySQL database.
<!-- Database based user manager -->
<driver>org.gjt.mm.mysql.Driver</driver>
<url>jdbc:mysql://localhost/ftpDB</url>
<user>user</user>
<password>password</password>
Configuration parameters :
- driver : Fully qualified name of the JDBC driver to be used.
- url : JDBC database URL.
- user : Database user.
- password : Database password.
Besides these, you need to copy the driver jar file in the lib directory.


