📄 teststore03.java
字号:
package connections;
public class TestStore03 {
public static void main(String[] args) {
int id = 3;
Store03 store = new Store03();
boolean result = store.findByPrimaryKey("3");
if (result) {
System.out.println("Store retrieved successfully");
System.out.println(store.toString());
} else {
System.out.println("Store NOT retrieved successfully");
return;
}
System.out.println("Updating local data for store");
store.setStoreAddress1("1370 Denny Way");
store.setStoreCity("Seattle");
store.setStorePostalCode("98001");
System.out.println("Attempting to update database");
result = store.update();
if (result) {
System.out.println("Store updated successfully");
} else {
System.out.println("Store NOT updated successfully");
return;
}
// retrieve again to show update
store = new Store03();
store.findByPrimaryKey("3");
System.out.println(store.toString());
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -