📄 518744d3b009001c13f29ceddc5e8d12
字号:
package bean;
import java.util.*;
import java.io.*;
import java.sql.*;
/**
* class StoreBook is a heavy weight representation
* of a book at a library
*/
public class StoreBookTitle
{
/**
* class StoreBook constructor
*/
public StoreBookTitle()
{}
/**
* getBook returns a book object with the specified id
* @param inBookId int id of book
* @return Book
*/
public static BookTitle getBookTitle( String inBookId )
throws Exception {
BookTitle myBook = null;
String sqlQuery = "select * from booktitle, isbn='" + inBookId + "'";
// Get a the singleton db wrapper
DBWrapper myConnection = DBWrapper.Instance();
ResultSet r = null;
r = myConnection.runQuery( sqlQuery );
if (r.next()) {
// create the book object
myBook=new BookTitle(r.getString("title"),r.getString("author"),r.getString("isbn"),r.getString("edition")
,r.getString("publisher"),r.getString("published_date"),r.getDouble("price"),r.getDouble("discount")
,r.getString("description"),r.getInt("qtyinstock"),r.getString("catalognum"));
}
// close the result set
r.close();
return myBook;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -