tString("name") %> </td>
<td width="174"><%= rst.getString("email") %> </td>
<td width="250"><%= rst.getString("pnote") %> <%= rst.getRow() %></td>
</tr>
<%
}
%>
</table>
</center>
</div>
</body>
</html>
Jodb.java文件如下:
package zbean;
import java.sql.*;
//import zbean.*;
public class Jodb
{
public String sdbdriver="sun.jdbc.odbc.JdbcOdbcDriver";
public String sConnStr;
public long count;
String uid;
String pwd;
Connection conn=null;
ResultSet rs=null;
public Jodb()
{
try
{
Class.forName(sdbdriver);
}
catch(java.lang.ClassNotFoundException e)
{
System.err.println("Jodb():"+e.getMessage());
}
}
public void setDbDriver(String y)
{
sdbdriver=y;
}
public void setConnStr(String x,String z,String a)
{
sConnStr=x;
uid=z;
pwd=a;
}
public ResultSet execute(String sql)
{
rs=null;
try
{
conn=DriverManager.getConnection(sConnStr,uid,pwd);
Statement stmt=conn.createStatement(java.sql.ResultSet.TYPE_SCROLL_SENSITIVE,java.sql.ResultSet.CONCUR_READ_ONLY);
rs=stmt.executeQuery(sql);
}
catch(SQLException ex)
{
System.err.println("Jodb.execute():"+ex.getMessage());
}
return rs;
}
public long update(String sql)
{
long x=0;
try
{
conn=DriverManager.getConnection(sConnStr);
Statement stmt=conn.createStatement();
x=stmt.executeUpdate(sql);
}
catch(SQLException ey)
{
System.err.println("Jodb.update():"+ey.getMessage());
}
return x;
}
public String pageStr(int page,int pageCount,String url,String showStr)
{
//String str="Page:("+page+"/"+pageCount+") ";
String str="";
String fstr;
String pstr;
String nstr;
String lstr;
//int page=currPage;
//int pageCount=pageCt;
if(showStr=="cn")
{
fstr="第一页";
pstr="";
nstr="";
lstr="最末页";
}
else if(showStr=="en")
{
fstr="First";
pstr="Previous";
nstr="Next";
lstr="Last";
}
else
{
String temp_a