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

📄 operaterecord.java

📁 用最近的dojo1.2.1制作前端的ajax购书网站
💻 JAVA
字号:
package historyRecord;
import server.database.*;
import server.books.*;
import java.sql.*;
import java.util.*;

/**
 * @author Administrator
 *
 * To change this generated comment edit the template variable "typecomment":
 * Window>Preferences>Java>Templates.
 * To enable and disable the creation of type comments go to
 * Window>Preferences>Java>Code Generation.
 */


public class operateRecord {
	recordData rd=new recordData();
	Operation op=new Operation();
	
	ResultSet rs;
	
	boolean updated=false;
	ArrayList recordSet=new ArrayList();
	
	ArrayList getRS(int t,String name)
	
	{
		recordSet.clear();
		
		String str="select * from "+recordData.TABLE+" where "+recordData.propety[4]+"=\'"+name+"\'";
		 try{
			rs=op.select(str);
		 	rs.next();
		 	String bookid=rs.getString("ids");
		 	System.out.println(bookid);
			ArrayList bookids=readBookID(bookid);
			for(int i=0;i<bookids.size();i++)
			{
				StringBuffer temp=(StringBuffer)bookids.get(i);
				String str_temp="select * from Book where id = \'"+temp.toString()+"\'";
				ResultSet rs1=op.select(str_temp);
				while(rs1.next())
				{
					
					MyBookClass bk1=new MyBookClass();
					bk1.setName(rs1.getString(MyBookClass.property[0]));
			        bk1.setId(rs1.getString(MyBookClass.property[1]));						   bk1.setAuthor(rs1.getString(MyBookClass.property[2]));
					bk1.setPublish(rs1.getString(MyBookClass.property[3]));
				    bk1.setPrice(Integer.parseInt(rs1.getString(MyBookClass.property[4])));
					bk1.setDiscount(Float.parseFloat(rs1.getString(MyBookClass.property[5])));
					recordSet.add(bk1);
				}
				
			}
			
				 
		 	}

	
		catch(ClassNotFoundException e){System.out.println(3333);}
	    catch(SQLException e){System.out.println( 3333);}
	    catch(InstantiationException e){System.out.println(3333);}
	    catch(IllegalAccessException e){System.out.println(3333);}
	
		return recordSet;
		
		
	

}

ArrayList readBookID(String id)
{	
	ArrayList bookid=new ArrayList();
	StringBuffer temp=new StringBuffer();
	int t=0;
	for(int i=0;i<id.length();i++)
	{
		StringBuffer temp2=new StringBuffer();
		if(id.charAt(i)==' ')
		{bookid.add(temp);temp=temp2;//temp.delete(0,temp.length()-1);
			continue;
		}
		else 
		
		temp.append(id.charAt(i));
 
		
		
	}
	bookid.add(temp);
	
	return bookid;
	
}
	
	
}

⌨️ 快捷键说明

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