该用户从未签到
|
沙发
发表于 2015-04-04 11:25:26
|只看该作者
# Use connection pooling. 使用连接池 connection pooling5 N( B: J3 W5 U' r) }
9 ^; z$ L7 W" p# w/ N# Choose appropriate isolation levels. 选择合适的隔离级别; _7 q' y7 W; s' [
2 e9 @7 H' V8 A) H a( J# Use Statement pooling. 使用statement pooling2 C- @8 W& \5 y; k
% R0 R7 n- Y' Z3 c5 B# Statements versus Prepared Statements: When to Use What? 合适的选用Statement 或者 PreparedStatement; U0 Q5 f$ S( _/ i+ b7 J! ]9 c+ g
! ^. E7 z! n* D0 o: L9 G# Tune the SQL to minimize the data returned (e.g. not ‘SELECT *’). 进行SQL调优来减少返回的数据集 比如不使用select ** m. [& d- T* o! ^) _) i( I0 x
7 ^2 M. H8 j; U; q# Avoid the Usage of Metadata Methods (e.g DatabaseMetaData.getColumns() whenever Possible. They are expensive. 尽可能的避免使用Metadata方法(比如DatabaseMetaData.getColumns()); T3 B( k# f/ b; z4 }) H
2 J2 C5 w4 v1 b, n+ [$ B+ ^6 Y( m
# Try to combine queries and batch updates. 合并查询和进行批量更新
2 c, D1 ?/ W/ m% H/ ?, z2 j. v7 r0 W. f: N) K8 p
# Use stored procedures.使用存储过程0 I7 C" C$ d: o1 U
9 o' S6 y2 F9 w+ _8 _! K+ U/ Y
# Cache data to avoid repeated queries.对数据进行缓存来避免重复查询1 \* x. ]* A4 t F& O4 `1 B+ M& f
+ e) {5 {, q: Z4 \# Close resources (Connections, Statements, ResultSets) when finished with.操作结束时关闭资源(连接,statement, ResultSet等等) |
|