forked from maxliaops/Java_Web_Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNewsShow.java
More file actions
40 lines (36 loc) · 1.07 KB
/
NewsShow.java
File metadata and controls
40 lines (36 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package cars;
import java.sql.*;
/**
* <p>Title: 华奥汽车销售集团网站</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2005</p>
* <p>Company: 明日科技有限公司</p>
* @author not attributable
* @version 1.0
*/
public class NewsShow {
String sql;
String show;
ResultSet rs;
int i=0;
public NewsShow() {
Bean1 data=new Bean1();
sql="select * from tb_News where Type='新闻报道' or Type='集团动向' or Type='新车报道' order by IssueDate";
try{
rs=data.getrs(sql);
rs.beforeFirst();
sql="";
while (rs.next()&&(i<10)){
sql=sql+"<tr><td height='20'> <a href='#'onClick=javascript:window.open('News_Particular.jsp?id="+rs.getInt("ID")+"','','width=500,height=560,toolbar=no,location=no,status=no,menubar=no') style='color:#000000'>"+rs.getString("Title")+"</a></td></tr>";
}
}
catch(SQLException ex){
ex.printStackTrace();
}
show="<table width='160' border='0' cellspacing='0' cellpadding='0'><tr>";
show=show+sql+"</table>";
}
public String getstring(){
return show;
}
}