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
ParameterDAO.java~3~
Package: LibraryManage.rar [view]
Upload User: toby828
Upload Date: 2015-06-26
Package Size: 8558k
Code Size: 1k
Category:
Jsp/Servlet
Development Platform:
Java
- package com.dao;
- import com.core.ConnDB;
- import com.actionForm.ParameterForm;
- import java.sql.ResultSet;
- public class ParameterDAO {
- ConnDB conn=null;
- public ParameterDAO() {
- conn=new ConnDB();
- }
- public ParameterForm query(){
- ParameterForm libraryForm1=null;
- String sql = "select * from tb_parameter where id=1";
- ResultSet rs =conn.executeQuery(sql);
- try {
- while (rs.next()) {
- libraryForm1 = new ParameterForm();
- libraryForm1.setId(Integer.valueOf(rs.getString(1)));
- libraryForm1.setCost(rs.getInt(2));
- libraryForm1.setValidity(rs.getInt(3));
- }
- } catch (Exception ex) {
- }
- conn.close();
- return libraryForm1;
- }
- public int update(ParameterForm libraryForm){
- String sql="UPDATE tb_parameter SET cost="+libraryForm.getCost()+",validity="+libraryForm.getValidity()+" where id=1";
- int ret=conn.executeUpdate(sql);
- System.out.println("修改参数设置信息时的SQL:"+sql);
- conn.close();
- return ret;
- }
- }