⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c04366459f0a001c126d85d192d96ccb

📁 这是一个小程序 网上书店用的 我们学生做的一个小实验
💻
字号:
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, B_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( "B_Title" ), r.getString( "B_Author" ),
				  r.getString( "B_ISBN" ), r.getString( "B_Edition" ),r.getString("Pub_num"),r.getString("B_DatePublished"), 
				  r.getDouble( "B_Price" ), r.getDouble( "B_discont" ),r.getString("B_Description"),r.getInt("B_qutlnStore"),
				  r.getString( "Categ_num" ));
	}
	// close the result set
	r.close();
	return myBook;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -