example of well-written jdbc code
来源:互联网 发布:app网络请求错误 编辑:程序博客网 时间:2024/06/05 03:40
public Employee getEmployee(int id) throws SQLException{Employee employee=null;String sql="SELECT * FORM EMPLOYEE WHERE EMPLOYEE_NUMBER=?";Connection conn=null;PreparedStatement ps=null;ResultSet rs=null;try{ conn=dataSource.getConnection(); ps=conn.prepareStatement(sql); ps.setInt(1,id); rs=ps.executeQuery(); while(rs.next()) { employee=new Employee();employee.setId(rs.getInt("ID")); employee.setEmployeeNumber(rs.getInt("EMPLOYEE_NUMBER")); employee.setFirstName(rs.getString("FIRST_NAME"); employee.setLastName(rs.getString("LAST_NAME")); employee.setTitle(rs.getString("TITLE")); }} finally{ try{ if(rs!=null) rs.close(); } finally{ try{ if(ps!=null) ps.close(); } finally{ if(conn!=null) conn.close(); } }}return employee;}
- example of well-written jdbc code
- example code of Ajax
- well code Abap
- A example code of multithread communication in Python
- Example Code of Using XML Parser in Symbian OS
- An example code in .net of AWS EC2
- Example code of searching in WordNet Dictionary with JAWS library
- Simple Lucene Example Code
- Driver development code example.
- java code example site
- Example code for LDD3
- An example code
- NSCopying & NSCoding Example Code
- RNTween code example
- RNTouchInput Example code
- drop procedure code example
- QTP code example
- Shell Code Example
- C语言暑期实习 第九天
- 如何学好OBJECTIVEC
- 如何用汉字的拼音对汉字排序
- 手机仍存随意处置风险
- 无废话ExtJs系列教程
- example of well-written jdbc code
- 【Cocos2d-X(2.x) 游戏开发系列之一】cocos2dx(v2.x)与(v1.x)的一些常用函数区别讲解!在2.x版CCFileData类被去除等
- hello world
- IAR 430 头文件中#define定义的部分解释
- 字典树
- 插 一条数据
- 关于MSP430 IDE IARv5.3
- Local transaction
- 美国密歇根大学指数不及预期,欧元低位反弹