import java.io.*; class Config{ String[] attribute={"item_word","maker_word","serial_word","price","highlows","cate"}; String[] attribute_jp={"商品名","キーワード","型番","値段","ハイロウ","カテゴリ"}; String[] attribute_type={"String","String","String","int","int","int"}; int[] attribute_length={50,50,10,14,1,1}; String[] attribute_parameter={"ITEM_NAME","ITEM_MAKER","ITEM_NUMBER","ITEM_PRICE","",""}; String[] result_parameter_jp={"ID","商品名","キーワード","値段","ポイント","定価","型番"}; String index_path ="/home/oracle/public_html/jsp/index.html"; String css_url="http://pw008.st.ie.u-ryukyu.ac.jp/~oracle/css/idstyle.css"; String search_table_path="/home/oracle/public_html/form/search_form"; String[] get_result_parameter_jp(){ return result_parameter_jp; } String[] get_attribute_parameter(){ return attribute; } String[] get_attribute_parameter_jp(){ return attribute_jp; } String get_index_path(){ return index_path; } String get_css_url(){ return css_url; } boolean sql_check_value(String dat,String type,int length){ if(type.equals("int")){ try{ int i= new Integer(dat).intValue(); if((i+"").length()<=length){ return true; } }catch(Exception e){ return false; } }else if(type.equals("String")){ if(dat.length()<=length)return true; } return false; } String sql_convert_table(String s){ try{ int num=new Integer(s).intValue(); switch(num){ case 0: return "*"; case 1: return "item_deji"; case 2: return "item_kaden"; case 3: return "item_pc"; case 4: return "item_ofice"; case 5: return "item_cdvd"; } }catch(Exception e){ return null; } return null; } String get_search_table(){ // return file(search_table_path); return "--商品名とメーカーから検索できます。またジャンルを指定して検索することもできます。"+ "<form action=\"http://pw008.st.ie.u-ryukyu.ac.jp:8081/nakaden/servlet/list\" method=\"post\">"+ "<table bgcolor=#ffffaa cellpadding=5 width=\"750\">"+ "<tr><td><table><tr><td>"+ "商品名 : <input type=\"text\" name=\"item_word\" value=\"\">"+ "</td><td>"+ "キーワード : <input type=\"text\" name=\"maker_word\"value=\"\"><br>"+ "</td></tr>"+ "<tr><td>"+ "型番 : <input type=\"text\" name=\"serial_word\" value=\"\">"+ "</td><td>"+ "値段 : <input type =\"text\" name=\"price\" value=\"\">"+ "<select name=\"highlows\"><option value=\"0\">以下</option><option value=\"1\">以上</option>"+ "</select></td></tr></table></td>"+ "<td bgcolor=#ffffaa>"+ "<center>カテゴリを指定</center>"+ "<select name=\"cate\">"+ "<option value=\"0\">指定しない</option>"+ "<option value=\"1\">AV・デジカメ館</option>"+ "<option value=\"2\">家電・健康館</option>"+ "<option value=\"3\">パソコン館</option>"+ "<option value=\"4\">文具・オフィス館</option>"+ "<option value=\"5\">CD・DVD館</option>"+ "</select></td></tr>"+ "</table>"+ "<input type=\"submit\" value=\"検索\" name=\"st_w\">"+ "<input type=\"reset\" value=\"reset\">"; } String file(String file_name){ String str=""; String s; try{ BufferedReader br = new BufferedReader(new FileReader(file_name)); while((s=br.readLine())!=null){ str+=((new String(s.getBytes("UTF-8")))+"\n"); } br.close(); }catch(Exception e){ str=e.toString(); } return str; } }