2020-02-26 19:43
@dogu 获取的时候使用:DbKit.getConfig("NEW_DB_KEY");或者是Db.use("NEW_DB_KEY");即可
2020-02-26 19:41
以Mysql为例:
String url = "jdbc:mysql://localhost:3306/dogu?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8";
String username = "root";
String password = "root";
String drive = "com.mysql.cj.jdbc.Driver";
Map map = new HashMap<>();
map.put(DruidDataSourceFactory.PROP_DRIVERCLASSNAME, drive);
map.put(DruidDataSourceFactory.PROP_URL, url);
map.put(DruidDataSourceFactory.PROP_USERNAME, username);
map.put(DruidDataSourceFactory.PROP_PASSWORD, password);
Dialect dialect = new MysqlDialect();
boolean showSql = true;
boolean devMode = false;
int transactionLevel = 0;
ICache cache = new EhCache();
Config config = new Config("NEW_DB_KEY", DruidDataSourceFactory.createDataSource(map), dialect, showSql, devMode, transactionLevel, IContainerFactory.defaultContainerFactory, cache);
DbKit.addConfig(config);
2017-04-08 11:30
@JFinal 谢谢波总,找到问题了:用ajaxflieupload上传文件的时候加上:type : "post",就可以了,但是还有一点不明白:为啥tomcat就没这种问题QAQ