该用户从未签到
|
沙发
发表于 2015-04-04 11:25:26
|只看该作者
# Use connection pooling. 使用连接池 connection pooling8 w5 ~6 u8 p" }8 t$ {6 b& @4 F" c6 k
: n* k. c- ^- S$ f) [# Choose appropriate isolation levels. 选择合适的隔离级别
5 Q2 O$ {+ N) w z5 A- z; w+ G0 p: N
. d, ^6 q" a; `, \8 m9 O# Use Statement pooling. 使用statement pooling
8 T( F) c# F5 f7 I. O$ \5 c8 O( P D0 o, i- ~* Y7 |
# Statements versus Prepared Statements: When to Use What? 合适的选用Statement 或者 PreparedStatement0 k" L# e$ D; f' r& X
) C6 u+ z# W' O' X7 U! F6 L! ^$ }# Tune the SQL to minimize the data returned (e.g. not ‘SELECT *’). 进行SQL调优来减少返回的数据集 比如不使用select *
; K; p% C( ]9 Q* @4 U$ _& a+ i' W: [% n! D
# Avoid the Usage of Metadata Methods (e.g DatabaseMetaData.getColumns() whenever Possible. They are expensive. 尽可能的避免使用Metadata方法(比如DatabaseMetaData.getColumns())
- T# j+ ^# F7 Y: {- y
& l, M! E5 e9 g& H5 \# B/ b# Try to combine queries and batch updates. 合并查询和进行批量更新4 g5 n I1 R [8 Y6 D
& q" u6 C# [. h- j3 V; K# ~. h# Use stored procedures.使用存储过程 D5 V& Y2 e: P9 q5 v$ c1 n% x. }! [
* l% G6 b' x0 F% N/ V# Y
# Cache data to avoid repeated queries.对数据进行缓存来避免重复查询
g8 t; N1 x( ~+ O/ T v5 M+ _0 g% H, |+ a4 d) X3 m1 p* M
# Close resources (Connections, Statements, ResultSets) when finished with.操作结束时关闭资源(连接,statement, ResultSet等等) |
|