?? b02fdf8a303d001d17a69a638fd816af
字號:
package com.ajax;
import java.io.*;
import java.util.*;
import java.sql.*;
import com.jdbc.*;
public class Ajax {
Statement psmt=null;
ResultSet rt =null;
String sql =null;
DataBaseConnection dbc = new DataBaseConnection();
public String getMessage(){
String rs=null;
int i=0;
sql="select number,name from ajax where number1 is null order by name";
try{
psmt=dbc.getConnection().createStatement();
rt=psmt.executeQuery(sql);
rs="";
while (rt.next()) {
rs = rs+ "<option value=\"" + rt.getString(1) + "\""; //從1開始的
if (i == 0) {
rs = rs + " selected ";
}
rs = rs + ">" + rt.getString(2) + "</option>";
i++;
}
}
catch(Exception e){
}
finally{
try{
psmt.close();
}
catch(Exception e){
}
dbc.close();
}
return rs;
}
public String getMessage(String code){
String rs=null;
sql="select distinct name from ajax where number1='"+code+"' ";
try{
psmt=dbc.getConnection().createStatement();
rt=psmt.executeQuery(sql);
rs="";
while (rt.next()) {
//rs = rs + rt.getString(1)+","+ rt.getString(2)+"$";
rs = rs + rt.getString(1)+"$";
}
}
catch(Exception e){
}
finally{
try{
psmt.close();
}
catch(Exception e){
}
dbc.close();
}
return rs;
}
public String getMessage1(String code){
String rs=null;
sql="select distinct number from ajax where name='"+code+"' ";
try{
psmt=dbc.getConnection().createStatement();
rt=psmt.executeQuery(sql);
rs="";
while (rt.next()) {
rs = rs + rt.getString(1)+","+ rt.getString(2)+"$";
}
}
catch(Exception e){
}
finally{
try{
psmt.close();
}
catch(Exception e){
}
dbc.close();
}
return rs;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -