最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
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;
}
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;
}
相关文章
- 人们熟悉的寄居蟹属于以下哪种分类 神奇海洋11月21日答案 11-21
- 第五人格11.22共研服有什么更新 11月22日共研服更新内容介绍 11-21
- 原神恰斯卡怎么培养 11-21
- 无期迷途四星装束是谁 11-21
- 王者荣耀帝丹高中校服怎么获得 11-21
- 光遇姆明季后续版本怎么玩 11-21