JDBC的MySQL配置properties文件

参考:

http://sgq0085.iteye.com/blog/1262469

 

e.g. 常用数据库URL
Derby:  jdbc:derby://localhost:1527/COREJAVA;create=true
PostgreSQL: jdbc:postgresql:COREJAVA
MySQL:  jdbc:mysql://host:port/database
Oracle:  jdbc:oracle:thin:@host:port:databse
JDBC URL的语法一般为: jdbc:subprotocol:other stuff
subprotocol用于指明连接到数据库的特定驱动程序。
other stuff参数的格式随所使用的subprotocol不同而不同。

androidpn中的配置文件:

 

[plain] view plain copy
 
    1. # JDBC Configuration  
    2. jdbcDriverClassName=com.mysql.jdbc.Driver  
    3. jdbcUrl=jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull  
    4. hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect  
    5. jdbcUsername=root  
    6. jdbcPassword=root  
    7. # DBCP Pool settings  
    8. jdbcInitialSize=5  
    9. jdbcMaxActive=10  
    10. jdbcMaxIdle=5  
    11. jdbcMaxWait=30000  
    12. jdbcValidationQuery=select 1  
posted @ 2017-05-17 22:58  Faron  阅读(1964)  评论(0编辑  收藏  举报