该用户从未签到
|
沙发
发表于 2015-04-04 11:25:26
|只看该作者
# Use connection pooling. 使用连接池 connection pooling* a) w+ q2 q+ e( `7 ^9 C
6 _5 p! _) c8 ~9 L8 i( k
# Choose appropriate isolation levels. 选择合适的隔离级别; E/ q* I! |6 ^. g$ R
# b6 J' \- O0 E/ {# ]4 D
# Use Statement pooling. 使用statement pooling
5 r, [( y. u/ c. c
# V& ?4 r. ]9 O# Statements versus Prepared Statements: When to Use What? 合适的选用Statement 或者 PreparedStatement) ?$ n/ H8 S) S7 S; \* B
, X2 k4 O I$ Z' ~* L! c# Tune the SQL to minimize the data returned (e.g. not ‘SELECT *’). 进行SQL调优来减少返回的数据集 比如不使用select *9 T3 V8 }# X' j% J; f" @6 c
2 |, [% m! \9 ? v; t( J/ d
# Avoid the Usage of Metadata Methods (e.g DatabaseMetaData.getColumns() whenever Possible. They are expensive. 尽可能的避免使用Metadata方法(比如DatabaseMetaData.getColumns())! k5 }9 ?% l/ y; U' v
: W) q1 f" }" B1 i( r: \$ y# Try to combine queries and batch updates. 合并查询和进行批量更新, D( z! c3 B% W; d* {# J
! C7 ?+ w: E# K5 j% a) d# Use stored procedures.使用存储过程
8 X2 ~2 s' {6 A( i8 G t4 ~
- D- U$ P, A' ?( ?$ A7 e: I+ e# Cache data to avoid repeated queries.对数据进行缓存来避免重复查询
, f' M6 j: {6 [* R0 o) `9 c- [ Q
b; s* u3 A; Z& A) i, M6 F/ J# Close resources (Connections, Statements, ResultSets) when finished with.操作结束时关闭资源(连接,statement, ResultSet等等) |
|