避免数据库表中的列名与某些数据库关键字冲突
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
alter table `t_settings` change column `value` `_value` varchar(64) NOT NULL;
|
||||
alter table `t_settings` change column `desc` `_desc` varchar(64) NOT NULL;
|
||||
@@ -0,0 +1,2 @@
|
||||
alter table `t_settings` change column `value` `_value` varchar(64) NOT NULL;
|
||||
alter table `t_settings` change column `desc` `_desc` varchar(64) NOT NULL;
|
||||
@@ -86,10 +86,10 @@ public class DatabaseStore {
|
||||
try {
|
||||
connection = DBUtil.getConnection();
|
||||
String sql = "insert into t_settings " +
|
||||
" (`id`, `value`, `desc`) values(?, ?, ?)" +
|
||||
" (`id`, `_value`, `_desc`) values(?, ?, ?)" +
|
||||
" ON DUPLICATE KEY UPDATE " +
|
||||
"`value` = ?," +
|
||||
"`desc` = ?";
|
||||
"`_value` = ?," +
|
||||
"`_desc` = ?";
|
||||
|
||||
|
||||
statement = connection.prepareStatement(sql);
|
||||
@@ -120,7 +120,7 @@ public class DatabaseStore {
|
||||
|
||||
try {
|
||||
connection = DBUtil.getConnection();
|
||||
String sql = "select `value`, `desc` from t_settings where `id` = ?";
|
||||
String sql = "select `_value`, `_desc` from t_settings where `id` = ?";
|
||||
|
||||
statement = connection.prepareStatement(sql);
|
||||
int index = 1;
|
||||
|
||||
Reference in New Issue
Block a user