Apache FtpServerデータベース管理ユーザー実装


Apache FtpServerデータベース管理ユーザー実装手順
 
Proxool接続プール構成
 
dbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc\:mysql\://127.0.0.1\:3306/study
jdbc.username=root
jdbc.password=root

##     
jdbc.alias =study

##     
jdbc.maximum-connection-count=50

##     
jdbc.minmum-connection-conunt =5 

##housekeeper                  .            5  .
jdbc.maximum-active-time=50000

##house keeper                ,house keeper               ,             
jdbc.house-keeping-sleep-time=30000

##         
jdbc.maximum-connection-lifetime=60000

##         
jdbc.prototype-count=2 

##           .house keeper           
jdbc.house-keeping-test-SQL=SELECT CURRENT_DATE

##         。   “10s,1m,1d” 
jdbc.statistics=10s,1m,1d

##       
jdbc.verbose=true

##  sql
jdbc.trace=true

##  
jdbc.statistics-log-level=DEBUG
jdbc.simultaneous-build-throttle=1
jdbc.overload-wIThout-refusal-lifetime=10000
jdbc.fatal-SQL-exception=ORA-1234

 
二Springプロファイル


            
		
			classpath:jdbc.properties
		
	

3 Apache FtpServer serverをSpringに統合し、Springプロファイルに次のコードを追加します.
 

		
			
				
					
				
			
		
		
			
				
			
		
		
	
  

 
4つのデータベースに基づいて構成を管理し、Server要素に次の構成コードを追加します.
 
 

			
				
					










					


INSERT INTO FTP_USER (userid, userpassword,
 homedirectory, enableflag, writepermission, idletime, uploadrate,
downloadrate) VALUES ('{userid}', '{userpassword}', '{homedirectory}','{enableflag}', 
'{writepermission}', {idletime}, {uploadrate},{downloadrate})
UPDATE FTP_USER SET userpassword='{userpassword}',homedirectory=
'{homedirectory}',enableflag={enableflag},writepermission={writepermission},idletime={idletime}
,uploadrate={uploadrate},downloadrate={downloadrate} 
WHERE userid='{userid}'

DELETE FROM FTP_USER WHERE userid = '{userid}'
SELECT userid, userpassword, homedirectory,
enableflag, writepermission, idletime, maxloginnumber,maxloginperip,uploadrate, downloadrate 
FROM FTP_USER WHERE userid = '{userid}'
SELECT userid FROM FTP_USER ORDER BY userid
SELECT userid FROM FTP_USER WHERE userid='{userid}' AND userid='admin'

SELECT userpassword from FTP_USER WHERE userid='{userid}'

五数ベースSqlスクリプト
 
CREATE TABLE FTP_USER (      
   userid VARCHAR(64) NOT NULL PRIMARY KEY,       
   userpassword VARCHAR(64),      
   homedirectory VARCHAR(128) NOT NULL,             
   enableflag BOOLEAN DEFAULT TRUE,    
   writepermission BOOLEAN DEFAULT FALSE,       
   idletime INT DEFAULT 0,             
   uploadrate INT DEFAULT 0,             
   downloadrate INT DEFAULT 0,
   maxloginnumber INT DEFAULT 0,
   maxloginperip INT DEFAULT 0
);

 
 
           Server       ,                  , Server      
Bean      ,                 ,                        。
                          ,   Select          
(maxloginnumber),IP   (maxloginperip)。             Sql  ,