Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
GateWayFactory.java
Package: BBS_system_on_java.rar [view]
Upload User: toby834
Upload Date: 2013-10-21
Package Size: 2613k
Code Size: 2k
Category:
Jsp/Servlet
Development Platform:
Java
- package net.acai.forum;
- /**
- * Title: 清清网络
- * Description:
- * Copyright: Copyright (c) 2002
- * Company: www.SuperSpace.com
- * @author: SuperSpace
- * @version 1.0
- */
- import net.acai.database.*;
- import net.acai.forum.GateWayNotFoundException;
- import java.sql.ResultSet;
- import java.util.Vector;
- import javax.servlet.http.*;
- import net.acai.util.*;
- public class GateWayFactory{
- public static Vector getGateWays() throws GateWayNotFoundException{
- try{
- DBConnect dbc=new DBConnect("select * from bbs.class order by id");
- ResultSet rs=dbc.executeQuery();
- Vector gateWayVector=new Vector();
- int gateWayID;
- String gateWayName;
- GateWay gateWay;
- while(rs.next()){
- gateWayID=rs.getInt(1);
- gateWayName=rs.getString(2);
- gateWay=new GateWay(gateWayID,gateWayName);
- gateWayVector.add(gateWay);
- }
- dbc.close();
- return gateWayVector;
- }
- catch(Exception e){
- throw new GateWayNotFoundException();
- }
- }
- public static GateWay getGateWay(HttpServletRequest request) throws Exception{
- int ID;
- try{
- ID=ParamUtil.getInt(request,"id");
- }
- catch(Exception e){
- throw new Exception("请您选择您要排序的分类的ID");
- }
- DBConnect dbc=new DBConnect();
- String sql="select id,class from bbs.class where id="+ID;
- ResultSet rs=dbc.executeQuery(sql);
- if(!rs.next())
- throw new Exception("没有找到相应的论坛分类。");
- //rs.next();
- GateWay gateWay=new GateWay(rs.getInt(1),rs.getString(2));
- dbc.close();
- return gateWay;
- }
- }