报错源代码:
re=sta.executeQuery();
if(re!=null){
Integer id2=re.getInt("FRUIT_ID");
String type=re.getString("type");
String breed=re.getString("breed");
String area=re.getString("area");
String brief=re.getString("brief");
Integer weight=re.getInt("weight");
Double price=re.getDouble("price");
fruit=new Fruit(id2, type, breed, area, brief, weight, price);
}
该行报错在于不能这样用不管你是否确定该resultset是否存在值都需要使用 reseltset的next()方法
这涉及到rs对象的存储方法。里面说白了就是指针。没next,指针根本没指向对应记录
修改:
re=sta.executeQuery();
if(re!=null){
while(re.next()){
Integer id2=re.getInt("FRUIT_ID");
String type=re.getString("type");
String breed=re.getString("breed");
String area=re.getString("area");
String brief=re.getString("brief");
Integer weight=re.getInt("weight");
Double price=re.getDouble("price");
fruit=new Fruit(id2, type, breed, area, brief, weight, price);
}
}
分享到:
相关推荐
Before entering the building each person has to look into a camera so we can take a still image of their face. For our purposes it suffices just to decide based on the image whether the person can ...
Before we look at how SQL Server uses and manages its memory, we need to ensure a full understanding of the more common memory related terms. The following definitions will help you understand how SQL...
Fundamentals of the JavaMail API Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Table of Contents If you're viewing this document online, you can click ...
SQL Server never asks for SIX locks directly, they are always the result of a conversion. For example, suppose a transaction scanned a page using an S lock and then subsequently decided to perform a ...
集合了 所有的 Unix命令大全 ...telnet 192.168.0.23 自己帐号 sd08077-you0 ftp工具 192.168.0.202 tools-toolss ... 各个 shell 可互相切换 ksh:$ sh:$ csh:guangzhou% bash:bash-3.00$ ... 命令和参数之间必需用空格隔...
This modification means that if you are creating zip files to be used as SFX's you will want to leave the OEMConvert property mentioned above, set to it's default value of True. Modified so that ...
Please click here to have a confirmation email sent so we can confirm your email address and start sending you newsletters again. Alternatively, you can update your subscriptions. Add your own ...
This occurs as a result of frequent write and read access, during your daily routines, while surfing or gaming, or due to frequent user access on Server. For a lasting maximum speed while accessing ...
LocalDateTime start = LocalDateTime.parse("2004-01-02 11:30:24", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); LocalDateTime end = LocalDateTime.parse("2004-03-26 13:31:40", DateTimeFormatter....
POPUP_MESSAGE Adds or removes members of the selected feature set. ACTIONS STANDARD END_OF_MENU ! *************** Edit Menu *************** AFTER UG_EDIT_UNDO_LIST BUTTON UG_EDIT_REDO LABEL &...
4.4 Set Gravity.........................................................66 4.5 Pretend Friction—Friction Simulation to Prevent Slipping Around........66 4.5.1 Script Breakdown...........................
To start the installation, change your current drive to the one that has the install program on it and type INSTALL. You will be given instructions in a box at the bottom of the screen for each ...
To start the installation, change your current drive to the one that has the install program on it and type INSTALL. You will be given instructions in a box at the bottom of the screen for each ...
* When using RefreshRecord on a Memo or Blobfield and the field has been modified by another user, the blobsize of that field does not change if it is less than before (Quality Central 4676).* ...
XPlite will set a restore point before making any changes to your system and it will warn you first if the restore point can not be set. Source Files ============ When installing optional components...
Instead, explicitly set the output handler using ob_start(). ; Using this ini directive may cause problems unless you know what script ; is doing. ; Note: You cannot use both "mb_output_handler" with...
Table of Contents Header Files The #define Guard Header File Dependencies Inline Functions The -inl.h Files Function Parameter Ordering Names and Order of Includes Scoping Namespaces Nested Classes ...
例句:The accident occurred as the result of careless driving. - **because of**:表示原因。例句:Because of the heavy traffic, we were late. - **due to**:表示原因。例句:The delay was due to bad ...
- Corrected a bug, where in rare cases, the result summary could be duplicated in a log file. - Updated license management, in an attempt to remove a rare crash on startup. Release 5.3 build 1012....
For this reason, the functions that handle these actions offer the option of waiting until the action is complete before returning (so-called synchronous operation); although they can be called in an ...