一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

servlet与javabean实现长文本数据分页显示

时间:2022-07-02 18:19:39 编辑:袖梨 来源:一聚教程网

这是做wap的时候遇到的问题,您遇到类似的问题可以参考一下!
javabean文件:
DataConnection.java;//数据库连接
BasicInfo.java;//数据bean容器
DataWork.java;//数据操作
servlet文件:
OrderInfoServlet.java;//servlet实现长文本数据分页显示
xml配置文件:
web.xml;//servlet配置
DataConnection.java文件内容为:
package wap_cctv_film;
import java.sql.*;
public class DataConnection {
public static Connection getDataConnection() {
Connection conn = null;
try {
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=wapvod","cctv_sql_user","cctv_sql_user");
}
catch (Exception ex) {
ex.printStackTrace();
}
return conn;
}
}
--------------------------------------------------------------------------------
BasicInfo.java文件内容:
package wap_cctv_film;
import java.io.*;
public class BasicInfo
implements Serializable {
private String basicName;
private int basicHits;
private int basicID;
private String basicText;
private int basicIsShow;
private int basicType;
public String getBasicName() {
return basicName;
}
public void setBasicName(String basicName) {
this.basicName = basicName;
}
public int getBasicHits() {
return basicHits;
}
public void setBasicHits(int basicHits) {
this.basicHits = basicHits;
}
public int getBasicID() {
return basicID;
}
public void setBasicID(int basicID) {
this.basicID = basicID;
}
public String getBasicText() {
return basicText;
}
public void setBasicText(String basicText) {
this.basicText = basicText;
}

热门栏目