该用户从未签到
|
沙发
发表于 2015-04-04 11:25:26
|只看该作者
# Use connection pooling. 使用连接池 connection pooling
( M: o6 y1 L( ]* \* _, V/ `" I! w) F& S" Z: H
# Choose appropriate isolation levels. 选择合适的隔离级别
# L# Q( y6 V- h# Z' S/ \2 w! d8 U
# Use Statement pooling. 使用statement pooling# U% b7 b6 E( d6 K
/ q2 j" ?2 S' \$ {$ t) C" i# Statements versus Prepared Statements: When to Use What? 合适的选用Statement 或者 PreparedStatement
' L; M: y: g) \ O* p( u% F) \! v: G- l& ]8 U0 g
# Tune the SQL to minimize the data returned (e.g. not ‘SELECT *’). 进行SQL调优来减少返回的数据集 比如不使用select *$ D& t. O4 U' I; x
+ x- B9 C1 I! H" A7 x( @& c& @
# Avoid the Usage of Metadata Methods (e.g DatabaseMetaData.getColumns() whenever Possible. They are expensive. 尽可能的避免使用Metadata方法(比如DatabaseMetaData.getColumns())
% K% N- J3 D; r3 z) M
0 E: J e2 J- @+ }1 f# Try to combine queries and batch updates. 合并查询和进行批量更新
* u; n+ i! c( v( Z$ W& `. p- |/ Z5 x. ^' K
# Use stored procedures.使用存储过程3 N, N( D/ C) h* m U. Z9 E
; s8 K8 W" T7 G
# Cache data to avoid repeated queries.对数据进行缓存来避免重复查询
9 V9 R) c+ t# N/ P$ \8 A; {2 V. E$ [1 `7 E
# Close resources (Connections, Statements, ResultSets) when finished with.操作结束时关闭资源(连接,statement, ResultSet等等) |
|