- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在创建一个 Java 桌面应用程序,该应用程序使用包含 50 多个数据变量的 SQLite 数据库。我有一个 DatabaseHelper 类,它具有以下变量:
//-- The SQLite Database Table name --//
private static final String STAN_RECORDS_TABLE = "STAN_SQLite_Records_Table"; // Primary Table - Table 1.
//-- The STAN Records DATABASE TABLE COLUMNS - or KEYS - defined here as static variables. --//
private static final String STAN_KEY_RECORDS_ID = "Stan_Records_id"; // Record 1
private static final String STAN_KEY_DATE_CREATED = "Date_Created"; // Record 2
private static final String STAN_KEY_EST_TYPE = "Stan_Est_Type"; // Record 3
private static final String STAN_KEY_CITY_TOWN = "City_Town"; // Record 4
private static final String STAN_KEY_LOC_LAT = "Loc_Lat"; // Record 5
private static final String STAN_KEY_LOC_LONG = "Loc_Long"; // Record 6
private static final String STAN_KEY_STREET_NAME = "Street_Name"; // Record 7
private static final String STAN_KEY_ERF_NUM = "Erf_Number"; // Record 8
private static final String STAN_KEY_SUBURB_NAME = "Suburb_Name"; // Record 9
private static final String STAN_KEY_ADDRESS_DESC = "Address_Desc"; // Record 10
private static final String STAN_KEY_RATE_SINGLE = "Single_Rate"; // Record 11
private static final String STAN_KEY_RATE_DOUBLE = "Double_Rate"; // Record 12
private static final String STAN_KEY_RATE_FAMILY = "Family_Rate"; // Record 13
private static final String STAN_KEY_RATE_VIP = "VIP_Rate"; // Record 14
private static final String STAN_KEY_CONTACTS_FIXED = "Fixed_Line"; // Record 15
private static final String STAN_KEY_CONTACTS_FAX = "Facsimile"; // Record 16
private static final String STAN_KEY_CONTACTS_MOBILE = "Mobile"; // Record 17
private static final String STAN_KEY_CONTACTS_EMAIL = "Email"; // Record 18
private static final String STAN_KEY_CONTACTS_WEB = "Website"; // Record 19
private static final String STAN_KEY_SELF_CATER = "Self_Cater"; // Record 20
private static final String STAN_KEY_PARKING_TYPE = "Parking_Type"; // Record 21
private static final String STAN_KEY_PARKING_SHADE = "Parking_Shade"; // Record 22
private static final String STAN_KEY_PARKING_BAYS = "Parking_Bays"; // Record 23
private static final String STAN_KEY_PARKING_RATING = "Parking_Rating"; // Record 24
private static final String STAN_KEY_SINGLE_UNITS = "Single_Units"; // Record 25
private static final String STAN_KEY_SINGLE_DESC = "Single_Desc"; // Record 26
private static final String STAN_KEY_DOUBLE_UNITS = "Double_Units"; // Record 27
private static final String STAN_KEY_DOUBLE_DESC = "Double_Desc"; // Record 28
private static final String STAN_KEY_FAMILY_UNITS = "Family_Units"; // Record 29
private static final String STAN_KEY_FAMILY_DESC = "Family_Desc"; // Record 30
private static final String STAN_KEY_VIP_UNITS = "VIP_Units"; // Record 31
private static final String STAN_KEY_VIP_DESC = "VIP_Desc"; // Record 32
private static final String STAN_KEY_SINGLE_DOUBLE = "Single_Doubles"; // Record 33
private static final String STAN_KEY_ROOM_COND = "Room_Condition"; // Record 34
private static final String STAN_KEY_ROOM_PRIVACY = "Room_Privacy"; // Record 35
private static final String STAN_KEY_BATHROOM_SHARED = "Bathroom_Shared"; // Record 36
private static final String STAN_KEY_AIR_CON = "Air_Con"; // Record 37
private static final String STAN_KEY_ROOM_FRIDGE = "Room_Fridge"; // Record 38
private static final String STAN_KEY_ROOM_TV = "Room_TV"; // Record 39
private static final String STAN_KEY_ROOM_BEDDING = "Room_Bedding"; // Record 40
private static final String STAN_KEY_ROOM_SIZE = "Room_Size"; // Record 41
private static final String STAN_KEY_BONUS_POOL = "Bonus_Pool"; // Record 42
private static final String STAN_KEY_BONUS_GYM = "Bonus_Gym"; // Record 43
private static final String STAN_KEY_BONUS_BAR = "Bonus_Bar"; // Record 44
private static final String STAN_KEY_HOOD_NAME = "Hood_Name"; // Record 45
private static final String STAN_KEY_HOOD_SAFETY = "Hood_Safety"; // Record 47
private static final String STAN_KEY_HOOD_CBD = "Hood_CBD"; // Record 48
private static final String STAN_KEY_HOOD_NEARBY = "Hood_Nearby"; // Record 49
private static final String STAN_KEY_TOURIST_RECO = "Tourist_Reco"; // Record 50
private static final String STAN_KEY_TOURIST_REASON = "Tourist_Reason"; // Record 51
private static final String STAN_KEY_INFO_CANCEL_POLICY = "Cancel_Policy"; // Record 52
private static final String STAN_KEY_INFO_OTHER_INFO = "Other_Info"; // Record 53
private static final String STAN_KEY_EST_DB_SCORE = "Est_DB_Score"; // Record 54
private static final String STAN_KEY_DATE_UPDATED = "Date_Updated"; // Record 55
private static final String STAN_KEY_SHUTTLE_SERVICE = "Shuttle_Service"; // Record 55
private static final String STAN_KEY_KITCHEN_AVAILABLE = "Kitchen"; // Record 56
private static final String STAN_KEY_BREAKFASTS = "Breakfast"; // Record 57
private static final String STAN_KEY_FREE_WIFI = "Free_Wifi"; // Record 58
private static final String STAN_KEY_EST_NAME = "Est_Name"; // Record 59
然后我有一个数据库创建字符串:
//-- STAN Records TABLE creation SQL Statement --//
private static final String CREATE_STAN_RECORDS_TABLE = "CREATE TABLE IF NOT EXISTS " + STAN_RECORDS_TABLE + " (" + /*0*/ STAN_KEY_RECORDS_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
+ /*1*/ STAN_KEY_EST_NAME + " VARCHAR(255)," + /*2*/ STAN_KEY_EST_TYPE + " VARCHAR(255), " + /*3*/ STAN_KEY_CITY_TOWN + " VARCHAR(255), " + /*4*/ STAN_KEY_DATE_CREATED + " VARCHAR(255), "
+ /*5*/ STAN_KEY_LOC_LAT + " VARCHAR(255), " + /*6*/ STAN_KEY_LOC_LONG + " VARCHAR(255), " + /*7*/ STAN_KEY_STREET_NAME + " VARCHAR(255), "
+ /*8*/ STAN_KEY_ERF_NUM + " VARCHAR(255), " + /*9*/ STAN_KEY_SUBURB_NAME + " VARCHAR(255), " + /*10*/ STAN_KEY_ADDRESS_DESC + " VARCHAR(255), "
+ /*11*/ STAN_KEY_RATE_SINGLE + " VARCHAR(255), " + /*12*/ STAN_KEY_RATE_DOUBLE + " VARCHAR(255), " + /*13*/ STAN_KEY_RATE_FAMILY + " VARCHAR(255), "
+ /*14*/ STAN_KEY_RATE_VIP + " VARCHAR(255), " + /*15*/ STAN_KEY_CONTACTS_FIXED + " VARCHAR(255), " + /*16*/ STAN_KEY_CONTACTS_FAX + " VARCHAR(255), "
+ /*17*/ STAN_KEY_CONTACTS_MOBILE + " VARCHAR(255), " + /*18*/ STAN_KEY_CONTACTS_EMAIL + " VARCHAR(255), " + /*19*/ STAN_KEY_CONTACTS_WEB + " VARCHAR(255), "
+ /*20*/ STAN_KEY_SELF_CATER + " VARCHAR(255), " + /*21*/ STAN_KEY_PARKING_TYPE + " VARCHAR(255), " + /*22*/ STAN_KEY_PARKING_SHADE + " VARCHAR(255), "
+ /*23*/ STAN_KEY_PARKING_BAYS + " VARCHAR(255), " + /*24*/ STAN_KEY_PARKING_RATING + " VARCHAR(255), " + /*25*/ STAN_KEY_SINGLE_UNITS + " VARCHAR(255), "
+ /*26*/ STAN_KEY_SINGLE_DESC + " VARCHAR(255), " + /*27*/ STAN_KEY_DOUBLE_UNITS + " VARCHAR(255), " + /*28*/ STAN_KEY_DOUBLE_DESC + " VARCHAR(255), "
+ /*29*/ STAN_KEY_FAMILY_UNITS + " VARCHAR(255), " + /*30*/ STAN_KEY_FAMILY_DESC + " VARCHAR(255), " + /*31*/ STAN_KEY_VIP_UNITS + " VARCHAR(255), "
+ /*32*/ STAN_KEY_VIP_DESC + " VARCHAR(255), " + /*33*/ STAN_KEY_SINGLE_DOUBLE + " VARCHAR(255), " + /*34*/ STAN_KEY_ROOM_COND + " VARCHAR(255), "
+ /*35*/ STAN_KEY_ROOM_PRIVACY + " VARCHAR(255), " + /*36*/ STAN_KEY_BATHROOM_SHARED + " VARCHAR(255), " + /*37*/ STAN_KEY_AIR_CON + " VARCHAR(255), "
+ /*38*/ STAN_KEY_ROOM_FRIDGE + " VARCHAR(255), " + /*39*/ STAN_KEY_ROOM_TV + " VARCHAR(255), " + /*40*/ STAN_KEY_ROOM_BEDDING + " VARCHAR(255), "
+ /*41*/ STAN_KEY_ROOM_SIZE + " VARCHAR(255), " + /*42*/ STAN_KEY_BONUS_POOL + " VARCHAR(255), " + /*43*/ STAN_KEY_BONUS_GYM + " VARCHAR(255), "
+ /*44*/ STAN_KEY_BONUS_BAR + " VARCHAR(255), " + /*45*/ STAN_KEY_HOOD_NAME + " VARCHAR(255), " + /*46*/ STAN_KEY_HOOD_SAFETY + " VARCHAR(255), "
+ /*47*/ STAN_KEY_HOOD_CBD + " VARCHAR(255), " + /*48*/ STAN_KEY_HOOD_NEARBY + " VARCHAR(255), " + /*49*/ STAN_KEY_TOURIST_RECO + " VARCHAR(255), "
+ /*50*/ STAN_KEY_TOURIST_REASON + " VARCHAR(255), " + /*51*/ STAN_KEY_INFO_CANCEL_POLICY + " VARCHAR(255), " + /*52*/ STAN_KEY_INFO_OTHER_INFO+ " VARCHAR(255), "
+ /*53*/ STAN_KEY_EST_DB_SCORE + " INTEGER, " + /*54*/ STAN_KEY_SHUTTLE_SERVICE + " VARCHAR(255), " + /*55*/ STAN_KEY_KITCHEN_AVAILABLE + " VARCHAR(255), "
+ /*56*/ STAN_KEY_BREAKFASTS + " VARCHAR(255), " + /*57*/ STAN_KEY_FREE_WIFI + " VARCHAR(255), " + /*58*/ STAN_KEY_DATE_UPDATED + " VARCHAR(255));";
...和一条记录插入字符串:
private static final String INSERT_ONE_COMPLETE_STAN_RECORDS_ENTRY = "INSERT INTO " + STAN_RECORDS_TABLE + " (" + /*1*/ STAN_KEY_EST_NAME + ", " + /*2*/ STAN_KEY_EST_TYPE + ", "
+ /*3*/ STAN_KEY_CITY_TOWN + ", " + /*4*/ STAN_KEY_DATE_CREATED + ", " + /*5*/ STAN_KEY_LOC_LAT + ", " + /*6*/ STAN_KEY_LOC_LONG + ", " + /*7*/ STAN_KEY_STREET_NAME + ", "
+ /*8*/ STAN_KEY_ERF_NUM + ", " + /*9*/ STAN_KEY_SUBURB_NAME + ", " + /*10*/ STAN_KEY_ADDRESS_DESC + ", " + /*11*/ STAN_KEY_RATE_SINGLE + ", " + /*12*/ STAN_KEY_RATE_DOUBLE + ", "
+ /*13*/ STAN_KEY_RATE_FAMILY + ", " + /*14*/ STAN_KEY_RATE_VIP + ", " + /*15*/ STAN_KEY_CONTACTS_FIXED + ", " + /*16*/ STAN_KEY_CONTACTS_FAX + ", " + /*17*/ STAN_KEY_CONTACTS_MOBILE + ", "
+ /*18*/ STAN_KEY_CONTACTS_EMAIL + ", " + /*19*/ STAN_KEY_CONTACTS_WEB + ", " + /*20*/ STAN_KEY_SELF_CATER + ", " + /*21*/ STAN_KEY_PARKING_TYPE + ", " + /*22*/ STAN_KEY_PARKING_SHADE + ", "
+ /*23*/ STAN_KEY_PARKING_BAYS + ", " + /*24*/ STAN_KEY_PARKING_RATING + ", " + /*25*/ STAN_KEY_SINGLE_UNITS + ", " + /*26*/ STAN_KEY_SINGLE_DESC + ", " + /*27*/ STAN_KEY_DOUBLE_UNITS + ", "
+ /*28*/ STAN_KEY_DOUBLE_DESC + ", " + /*29*/ STAN_KEY_FAMILY_UNITS + ", " + /*30*/ STAN_KEY_FAMILY_DESC + ", " + /*31*/ STAN_KEY_VIP_UNITS + ", " + /*32*/ STAN_KEY_VIP_DESC + ", "
+ /*33*/ STAN_KEY_SINGLE_DOUBLE + ", " + /*34*/ STAN_KEY_ROOM_COND + ", " + /*35*/ STAN_KEY_ROOM_PRIVACY + ", " + /*36*/ STAN_KEY_BATHROOM_SHARED + ", " + /*37*/ STAN_KEY_AIR_CON + ", "
+ /*38*/ STAN_KEY_ROOM_FRIDGE + ", " + /*39*/ STAN_KEY_ROOM_TV + ", " + /*40*/ STAN_KEY_ROOM_BEDDING + ", " + /*41*/ STAN_KEY_ROOM_SIZE + ", " + /*42*/ STAN_KEY_BONUS_POOL + ", "
+ /*43*/ STAN_KEY_BONUS_GYM + ", " + /*44*/ STAN_KEY_BONUS_BAR + ", " + /*45*/ STAN_KEY_HOOD_NAME + ", " + /*46*/ STAN_KEY_HOOD_SAFETY + ", " + /*47*/ STAN_KEY_HOOD_CBD + ", "
+ /*48*/ STAN_KEY_HOOD_NEARBY + ", " + /*49*/ STAN_KEY_TOURIST_RECO + ", " + /*50*/ STAN_KEY_TOURIST_REASON + ", " + /*51*/ STAN_KEY_INFO_CANCEL_POLICY + ", "
+ /*52*/ STAN_KEY_INFO_OTHER_INFO+ ", " + /*53*/ STAN_KEY_EST_DB_SCORE+ ", " + /*54*/ STAN_KEY_SHUTTLE_SERVICE + ", " + /*55*/ STAN_KEY_KITCHEN_AVAILABLE + ", "
+ /*56*/ STAN_KEY_BREAKFASTS + ", " + /*57*/ STAN_KEY_FREE_WIFI + ", " + /*58*/ STAN_KEY_DATE_UPDATED + ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, "
+ "?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
...以及记录 UPDATE 字符串(这就是问题!!):
private static final String UPDATE_ONE_COMPLETE_STAN_RECORDS_ENTRY = "UPDATE " + STAN_RECORDS_TABLE + " SET " + /*1*/ STAN_KEY_EST_NAME + " = ?, " + /*2*/ STAN_KEY_EST_TYPE + " = ?, "
+ /*3*/ STAN_KEY_CITY_TOWN + " = ?, " + /*4*/ STAN_KEY_DATE_CREATED + " = ?, " + /*5*/ STAN_KEY_LOC_LAT + " = ?, " + /*6*/ STAN_KEY_LOC_LONG + " = ?, " + /*7*/ STAN_KEY_STREET_NAME + " = ?, "
+ /*8*/ STAN_KEY_ERF_NUM + " = ?, " + /*9*/ STAN_KEY_SUBURB_NAME + " = ?, " + /*10*/ STAN_KEY_ADDRESS_DESC + " = ?, " + /*11*/ STAN_KEY_RATE_SINGLE + " = ?, " + /*12*/ STAN_KEY_RATE_DOUBLE + " = ?, "
+ /*13*/ STAN_KEY_RATE_FAMILY + " = ?, " + /*14*/ STAN_KEY_RATE_VIP + " = ?, " + /*15*/ STAN_KEY_CONTACTS_FIXED + " = ?, " + /*16*/ STAN_KEY_CONTACTS_FAX + " = ?, " + /*17*/ STAN_KEY_CONTACTS_MOBILE + " = ?, "
+ /*18*/ STAN_KEY_CONTACTS_EMAIL + " = ?, " + /*19*/ STAN_KEY_CONTACTS_WEB + " = ?, " + /*20*/ STAN_KEY_SELF_CATER + " = ?, " + /*21*/ STAN_KEY_PARKING_TYPE + " = ?, " + /*22*/ STAN_KEY_PARKING_SHADE + " = ?, "
+ /*23*/ STAN_KEY_PARKING_BAYS + " = ?, " + /*24*/ STAN_KEY_PARKING_RATING + " = ?, " + /*25*/ STAN_KEY_SINGLE_UNITS + " = ?, " + /*26*/ STAN_KEY_SINGLE_DESC + " = ?, " + /*27*/ STAN_KEY_DOUBLE_UNITS + " = ?, "
+ /*28*/ STAN_KEY_DOUBLE_DESC + " = ?, " + /*29*/ STAN_KEY_FAMILY_UNITS + " = ?, " + /*30*/ STAN_KEY_FAMILY_DESC + " = ?, " + /*31*/ STAN_KEY_VIP_UNITS + " = ?, " + /*32*/ STAN_KEY_VIP_DESC + " = ?, "
+ /*33*/ STAN_KEY_SINGLE_DOUBLE + " = ?, " + /*34*/ STAN_KEY_ROOM_COND + " = ?, " + /*35*/ STAN_KEY_ROOM_PRIVACY + " = ?, " + /*36*/ STAN_KEY_BATHROOM_SHARED + " = ?, " + /*37*/ STAN_KEY_AIR_CON + " = ?, "
+ /*38*/ STAN_KEY_ROOM_FRIDGE + " = ?, " + /*39*/ STAN_KEY_ROOM_TV + " = ?, " + /*40*/ STAN_KEY_ROOM_BEDDING + " = ?, " + /*41*/ STAN_KEY_ROOM_SIZE + " = ?, " + /*42*/ STAN_KEY_BONUS_POOL + " = ?, "
+ /*43*/ STAN_KEY_BONUS_GYM + " = ?, " + /*44*/ STAN_KEY_BONUS_BAR + " = ?, " + /*45*/ STAN_KEY_HOOD_NAME + " = ?, " + /*46*/ STAN_KEY_HOOD_SAFETY + " = ?, " + /*47*/ STAN_KEY_HOOD_CBD + " = ?, "
+ /*48*/ STAN_KEY_HOOD_NEARBY + " = ?, " + /*49*/ STAN_KEY_TOURIST_RECO + " = ?, " + /*50*/ STAN_KEY_TOURIST_REASON + " = ?, " + /*51*/ STAN_KEY_INFO_CANCEL_POLICY + " = ?, "
+ /*52*/ STAN_KEY_INFO_OTHER_INFO+ " = ?, " + /*53*/ STAN_KEY_EST_DB_SCORE+ " = ?, " + /*54*/ STAN_KEY_SHUTTLE_SERVICE + " = ?, " + /*55*/ STAN_KEY_KITCHEN_AVAILABLE + " = ?, "
+ /*56*/ STAN_KEY_BREAKFASTS + " = ?, " + /*57*/ STAN_KEY_FREE_WIFI + " = ?, " + /*58*/ STAN_KEY_DATE_UPDATED + " = ?" + " WHERE " + STAN_KEY_RECORDS_ID + " = ?";
这是我实际的 SQLite Update 查询方法:
@Override
public void updateRecordByDatabaseId (StanRecord stanRecord, int dbID) {
Connection stanDbCon = null;
PreparedStatement stanDbPrepState = null;
try {
// [1] Make an SQL connection the STAN Records SQLite database.
stanDbCon = StanConnectConfig.getStanConnection();
// [2] Define the SQLite Statement to be used for inserting data into the database.
stanDbPrepState = stanDbCon.prepareStatement(UPDATE_ONE_COMPLETE_STAN_RECORDS_ENTRY);
// [3] Insert the passed data into the STAN Records SQLite database (one-by-one).
stanDbPrepState.setString(1, stanRecord.getEstablishment_Name()); // Entry 1: Est_Name
stanDbPrepState.setString(2, stanRecord.getEstablishment_Type()); // Entry 2: Est_Type
stanDbPrepState.setString(3, stanRecord.getCity_Town()); // Entry 3: City_Town
stanDbPrepState.setString(4, stanRecord.getDate_Created()); // Entry 4: Date_Created
stanDbPrepState.setString(5, stanRecord.getLoc_Lat()); // Entry 5: Loc_Lat
stanDbPrepState.setString(6, stanRecord.getLoc_Long()); // Entry 6: Loc_Long
stanDbPrepState.setString(7, stanRecord.getPhys_Street_Name()); // Entry 7: Street_Name
stanDbPrepState.setString(8, stanRecord.getPhys_Erf_Number()); // Entry 8: Erf_Number
stanDbPrepState.setString(9, stanRecord.getPhys_Suburb_Name()); // Entry 9: Suburb_Name
stanDbPrepState.setString(10, stanRecord.getPhys_Address_Desc()); // Entry 10: Address_Desc
stanDbPrepState.setString(11, stanRecord.getRate_Single()); // Entry 11: Rate_Single
stanDbPrepState.setString(12, stanRecord.getRate_Double()); // Entry 12: Rate_Double
stanDbPrepState.setString(13, stanRecord.getRate_Family()); // Entry 13: Rate_Family
stanDbPrepState.setString(14, stanRecord.getRate_Vip()); // Entry 14: Rate_VIP
stanDbPrepState.setString(15, stanRecord.getContacts_Fixed()); // Entry 15: Contacts_Fixed
stanDbPrepState.setString(16, stanRecord.getContacts_Fax()); // Entry 16: Contacts_Fax
stanDbPrepState.setString(17, stanRecord.getContacts_Mobile()); // Entry 17: Contacts_Mobile
stanDbPrepState.setString(18, stanRecord.getContacts_Email()); // Entry 18: Contacts_Email
stanDbPrepState.setString(19, stanRecord.getContacts_Website()); // Entry 19: Contacts_Website
stanDbPrepState.setString(20, stanRecord.getSelf_Cater()); // Entry 20: Self_Cater
stanDbPrepState.setString(21, stanRecord.getParking_Type()); // Entry 21: Parking_Type
stanDbPrepState.setString(22, stanRecord.getParking_Shade()); // Entry 22: Parking_Shade
stanDbPrepState.setString(23, stanRecord.getParking_Bays()); // Entry 23: Parking_Bays
stanDbPrepState.setString(24, stanRecord.getParking_Rating()); // Entry 24: Parking_Rating
stanDbPrepState.setString(25, stanRecord.getRooms_Single_Units()); // Entry 25: Single_Units
stanDbPrepState.setString(26, stanRecord.getRooms_Single_Desc()); // Entry 26: Single_Desc
stanDbPrepState.setString(27, stanRecord.getRooms_Double_Units()); // Entry 27: Double_Units
stanDbPrepState.setString(28, stanRecord.getRooms_Double_Desc()); // Entry 28: Double_Desc
stanDbPrepState.setString(29, stanRecord.getRooms_Family_Units()); // Entry 29: Family_Units
stanDbPrepState.setString(30, stanRecord.getRooms_Family_Desc()); // Entry 30: Family_Desc
stanDbPrepState.setString(31, stanRecord.getRooms_Vip_Units()); // Entry 31: VIP_Units
stanDbPrepState.setString(32, stanRecord.getRooms_Vip_Desc()); // Entry 32: VIP_Desc
stanDbPrepState.setString(33, stanRecord.getRooms_Single_Double()); // Entry 33: Single_Double
stanDbPrepState.setString(34, stanRecord.getRooms_Overall_Condition()); // Entry 34: Overall_Condition
stanDbPrepState.setString(35, stanRecord.getRooms_Privacy()); // Entry 35: Room_Privacy
stanDbPrepState.setString(36, stanRecord.getRooms_Bath_Shared()); // Entry 36: Bath_Shared
stanDbPrepState.setString(37, stanRecord.getInroom_Air_Con()); // Entry 37: Air_Con
stanDbPrepState.setString(38, stanRecord.getInroom_Fridge()); // Entry 38: Room_Fridge
stanDbPrepState.setString(39, stanRecord.getInroom_Tv()); // Entry 39: Room_TV
stanDbPrepState.setString(40, stanRecord.getInroom_Bedding()); // Entry 40: Room_Bedding
stanDbPrepState.setString(41, stanRecord.getInroom_Space()); // Entry 41: Room_Size or Space
stanDbPrepState.setString(42, stanRecord.getBonus_Fac_Pool()); // Entry 42: Bonus_Pool
stanDbPrepState.setString(43, stanRecord.getBonus_Fac_Gym()); // Entry 43: Bonus_Gym
stanDbPrepState.setString(44, stanRecord.getBonus_Fac_Bar()); // Entry 44: Bonus_inHouse Bar
stanDbPrepState.setString(45, stanRecord.getHood_Name()); // Entry 45: Hood_Name
stanDbPrepState.setString(46, stanRecord.getHood_Safety()); // Entry 46: Hood_Safety
stanDbPrepState.setString(47, stanRecord.getHood_Dist_Cbd()); // Entry 47: Hood_CBD
stanDbPrepState.setString(48, stanRecord.getHood_Nearby_Attractions()); // Entry 48: Hood_Other Unknown
stanDbPrepState.setString(49, stanRecord.getTourist_Rating_Reco()); // Entry 49: Tourist_Recommendation
stanDbPrepState.setString(50, stanRecord.getTourist_Rating_Reason()); // Entry 50: Tourist_Reason
stanDbPrepState.setString(51, stanRecord.getInfo_Cancel_Policy()); // Entry 51: Cancel_Policy
stanDbPrepState.setString(52, stanRecord.getInfo_Other_Info()); // Entry 52: Other_Info
stanDbPrepState.setInt(53, stanRecord.getStan_Db_Sore()); // Entry 53: DataBase_Score
stanDbPrepState.setString(54, stanRecord.getStan_Fac_Shuttle()); // Entry 54: Shuttle_Service
stanDbPrepState.setString(55, stanRecord.getStan_Fac_Kitchen()); // Entry 55: Kitchen_Availability
stanDbPrepState.setString(56, stanRecord.getStan_Fac_Breakfast()); // Entry 56: Breakfast_Quality
stanDbPrepState.setString(57, stanRecord.getStan_Fac_Wifi()); // Entry 57: Free_WiFi
stanDbPrepState.setString(58, stanRecord.getDate_Updated()); // Entry 58: Date_Updated
// [4] Identify the location point in Stan Database.
stanDbPrepState.setInt(59, dbID);
// [5] Execute the data insertion into the Records database.
stanDbPrepState.executeUpdate();
// [6] Confirm data insert with an alert to user.
// System.out.println("\n" + UPDATE_ONE_COMPLETE_STAN_RECORDS_ENTRY);
JOptionPane.showMessageDialog(null, UPDATE_ONE_COMPLETE_STAN_RECORDS_ENTRY);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (stanDbPrepState != null) {
try {
stanDbPrepState.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
if (stanDbCon != null) {
try {
stanDbCon.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}
所有 SQLite 方法(创建、读取、插入和删除)都运行良好。只是 Update 方法不起作用。它一直执行以显示 JOptionPane 代码...
JOptionPane.showMessageDialog(null, UPDATE_ONE_COMPLETE_STAN_RECORDS_ENTRY);
...甚至显示消息,就好像数据已成功更新一样。但是,当您查看要更新的行时,没有任何更改(仍然是原始插入数据)。请帮忙 - 我已经在这个代码上苦苦挣扎了一个多星期了。请注意:我对纯 Java 编程相当陌生。我正在使用 IntelliJ IDEA IDE 来开发此应用程序。任何帮助将不胜感激。提前致谢。海岸-T!
最佳答案
索引 3 被设置两次。第二次设置时,它被设置为 int。
关于java - 奇怪的 SQLite 行为 - 非功能性 UPDATE SQLite 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29996206/
我正在编写一个具有以下签名的 Java 方法。 void Logger(Method method, Object[] args); 如果一个方法(例如 ABC() )调用此方法 Logger,它应该
我是 Java 新手。 我的问题是我的 Java 程序找不到我试图用作的图像文件一个 JButton。 (目前这段代码什么也没做,因为我只是得到了想要的外观第一的)。这是我的主课 代码: packag
好的,今天我在接受采访,我已经编写 Java 代码多年了。采访中说“Java 垃圾收集是一个棘手的问题,我有几个 friend 一直在努力弄清楚。你在这方面做得怎么样?”。她是想骗我吗?还是我的一生都
我的 friend 给了我一个谜语让我解开。它是这样的: There are 100 people. Each one of them, in his turn, does the following
如果我将使用 Java 5 代码的应用程序编译成字节码,生成的 .class 文件是否能够在 Java 1.4 下运行? 如果后者可以工作并且我正在尝试在我的 Java 1.4 应用程序中使用 Jav
有关于why Java doesn't support unsigned types的问题以及一些关于处理无符号类型的问题。我做了一些搜索,似乎 Scala 也不支持无符号数据类型。限制是Java和S
我只是想知道在一个 java 版本中生成的字节码是否可以在其他 java 版本上运行 最佳答案 通常,字节码无需修改即可在 较新 版本的 Java 上运行。它不会在旧版本上运行,除非您使用特殊参数 (
我有一个关于在命令提示符下执行 java 程序的基本问题。 在某些机器上我们需要指定 -cp 。 (类路径)同时执行java程序 (test为java文件名与.class文件存在于同一目录下) jav
我已经阅读 StackOverflow 有一段时间了,现在我才鼓起勇气提出问题。我今年 20 岁,目前在我的家乡(罗马尼亚克卢日-纳波卡)就读 IT 大学。足以介绍:D。 基本上,我有一家提供簿记应用
我有 public JSONObject parseXML(String xml) { JSONObject jsonObject = XML.toJSONObject(xml); r
我已经在 Java 中实现了带有动态类型的简单解释语言。不幸的是我遇到了以下问题。测试时如下代码: def main() { def ks = Map[[1, 2]].keySet()
一直提示输入 1 到 10 的数字 - 结果应将 st、rd、th 和 nd 添加到数字中。编写一个程序,提示用户输入 1 到 10 之间的任意整数,然后以序数形式显示该整数并附加后缀。 public
我有这个 DownloadFile.java 并按预期下载该文件: import java.io.*; import java.net.URL; public class DownloadFile {
我想在 GUI 上添加延迟。我放置了 2 个 for 循环,然后重新绘制了一个标签,但这 2 个 for 循环一个接一个地执行,并且标签被重新绘制到最后一个。 我能做什么? for(int i=0;
我正在对对象 Student 的列表项进行一些测试,但是我更喜欢在 java 类对象中创建硬编码列表,然后从那里提取数据,而不是连接到数据库并在结果集中选择记录。然而,自从我这样做以来已经很长时间了,
我知道对象创建分为三个部分: 声明 实例化 初始化 classA{} classB extends classA{} classA obj = new classB(1,1); 实例化 它必须使用
我有兴趣使用 GPRS 构建车辆跟踪系统。但是,我有一些问题要问以前做过此操作的人: GPRS 是最好的技术吗?人们意识到任何问题吗? 我计划使用 Java/Java EE - 有更好的技术吗? 如果
我可以通过递归方法反转数组,例如:数组={1,2,3,4,5} 数组结果={5,4,3,2,1}但我的结果是相同的数组,我不知道为什么,请帮助我。 public class Recursion { p
有这样的标准方式吗? 包括 Java源代码-测试代码- Ant 或 Maven联合单元持续集成(可能是巡航控制)ClearCase 版本控制工具部署到应用服务器 最后我希望有一个自动构建和集成环境。
我什至不知道这是否可能,我非常怀疑它是否可能,但如果可以,您能告诉我怎么做吗?我只是想知道如何从打印机打印一些文本。 有什么想法吗? 最佳答案 这里有更简单的事情。 import javax.swin
我是一名优秀的程序员,十分优秀!