【文章內(nèi)容簡介】
7. JDBC 新功能 8. Q amp。 A 物件導(dǎo)向分析與資料庫設(shè)計(jì)技巧 ObjectRelation Mapping ? One table for each class ? One table for each concrete class ? One table for an entire class hierarchy 物件導(dǎo)向分析與資料庫設(shè)計(jì)技巧 ObjectRelation Mapping ? One table for each class 物件導(dǎo)向分析與資料庫設(shè)計(jì)技巧 Advantages: ? This approach most closely conforms to objectoriented concepts. ? It supports polymorphism. ? Maintenance is easy because there is no duplication. Disadvantages: ? There are many tables to maintain. ? It takes longer to read and write to the tables. ? Reporting directly from tables is table for each concrete classOne table for an entire class hierarchy 物件導(dǎo)向分析與資料庫設(shè)計(jì)技巧 ObjectRelation Mapping ? One table for each concrete class 物件導(dǎo)向分析與資料庫設(shè)計(jì)技巧 Advantages: ? Reporting directly from tables is easy. Disadvantages: ? If you modify a class, you must modify its table and the table for any subclasses. ? Data definitions are duplicated. 物件導(dǎo)向分析與資料庫設(shè)計(jì)技巧 ObjectRelation Mapping ? One table for an entire class hierarchy 物件導(dǎo)向分析與資料庫設(shè)計(jì)技巧 Advantages: ? The model is easy to understand. ? Polymorphism is supported. ? Reporting directly from tables is easy. Disadvantages: ? Database table must be changed with each addition. ? Database tables can bee extremely large. ? It is difficult to enforce rules on the database. 物件導(dǎo)向分析與資料庫設(shè)計(jì)技巧 Disadvantages: ? Each time you add a new attribute, the database table requires a change. ? When you add a new column, you might need to update all records with a value for that column. ? Routine maintenance takes more time. 1. 什麼是 JDBC? 2. JDBC Drivers之分類與使用時(shí)機(jī) 3. 使用 JDBC開發(fā)資料庫應(yīng)用程式 4. 物件導(dǎo)向分析與資料庫設(shè)計(jì)技巧 5. Connection pooling 6. 交易 (Transaction)處理方式 7. JDBC 新功能 8. Q amp。 A Connection pooling Why Connection pooling? ? Client 端不需安裝 JDBC Driver ? 將建立 Connection 的時(shí)間提前 ? 使 Connection 能提供其他程式輪替使用 ? 顯著地提升應(yīng)用程式的效率 Connection pooling Data Base C C C C C C C C Middle Tier Connection pooling Example Connection con = (jdbc/webDatabase, marcl, mpuppet)。 (false)。 // The actual work (queries and updates) would go here. ()。 ()。 Connect