Spring data source basic configuration _ MySQL

Source: Internet
Author: User
Configure aplictaionContext-dataSource for the spring Data source:

 1 
  2 
 
   7  8     
  
   10         
   
    11             
    
     12                 
     
      classpath:config.properties
     13             
    14         
   15     
  16 17     
  
   19         
   
    20             
    
     ${sqlDriver}
    21         
   22         
   
    23             
    
     ${sqlUrl}
    24         
   25         
   
    26             
    
     ${sqlUserName}
    27         
   28         
   
    29             
    
     ${sqlPassword}
    30         
   31         
   
    32             
    
     ${sqlMaxActive}
    33         
   34         
   
    35             
    
     ${sqlMaxWait}
    36         
   37         
   
    38             
    
     ${sqlMaxIdle}
    39         
   40     
  41 42 
 
PropertyConfigurer is used to configure the location of the config. properties File for reference in datasource configuration.
The config configuration file is written as follows:
1 sqlDriver=com.mysql.jdbc.Driver2 sqlUrl=jdbc:mysql://127.0.0.1:3306/mydatabase?useUnicode=true&characterEncoding=utf83 sqlUserName=root4 sqlPassword=1235 sqlMaxActive=5006 sqlMaxWait=10007 sqlMaxIdle=50

Record it for future Configuration Reference.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.