freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

javajdbc外文翻譯外文文獻(xiàn)英文文獻(xiàn)-全文預(yù)覽

2025-08-30 04:16 上一頁面

下一頁面
  

【正文】 s that you can create a class implementing the PlugIn interface to do something at application startup or shutdown. Say I am creating a web application where I am using Hibernate as the persistence mechanism, and I want to initialize Hibernate as soon as the application starts up, so that by the time my web application receives the first request, Hibernate is already configured and ready to use. We also want to close down Hibernate when the application is shutting down. We can implement this requirement with a Hibernate PlugIn by following two simple steps.Create a class implementing the PlugIn interface, like this: public class HibernatePlugIn implements PlugIn{ private String configFile。ll get better performance than if you executed each SQL statement separately from your program. This performance gain is the result of your program not having to move all the related data back and forth over the network, which is often the slowest part of the data manipulation process. This is how stored procedures are supposed to be used with Oraclenot as a substitute for SQL, but as a means to perform work where it can be done most efficiently.OCI Versus Thin DriversOracle39。s take a look at the performance of callable statements.CallableStatementsAs you may recall, CallableStatement objects are used to execute database stored procedures. I39。s see what we can do to squeak out a little performance while selecting data.Predefined SELECT StatementsEvery time you execute a SELECT statement, the JDBC driver makes two round trips to the database. On the first round trip, it retrieves the metadata for the columns you are selecting. On the second round trip, it retrieves the actual data you selected. With this in mind, you can improve the performance of a SELECT statement by 50% if you predefine the Selecstatement by using Oracle39。s proprietary batching.Now, let39。re really going to do that many executions of a statement, or perhaps more than 50, you should consider batching. Batching is more efficient because it sends multiple SQL statements to the server at one time. Although JDBC defines batching capability for Statement objects, Oracle supports batching only when PreparedStatement objects are used. This makes some sense. A SQL statement in a PreparedStatement object is parsed once and can be reused many times. This naturally lends itself to batching. The OCI DriverTable 195 lists Statement and batched PreparedStatement timings, in milliseconds, for 1 insert and for 1,000 inserts. At the low end, one insert, you take a small performance hit for supporting batching. At the high end, 1,000 inserts, you39。ll see that the Thin driver follows the same behavior as the OCI driver. However, since the Statement object starts out performing better than the PreparedStatement object, it takes about 125 inserts for the PreparedStatement to outperform Statement.Table 194: Thin driver timings (in milliseconds)InsertsStatementPreparedStatement1101131,0002,5831,739Figure 192When you consider typical SQL statement usage, even with the Thin driver, you39。s a popular belief that using a PreparedStatement object is faster than using a Statement object. After all, a prepared statement has to verify its metadata against the database only once, while a statement has to do it every time. So how could it be any other way? Well, the truth of the matter is that it takes about 65 iterations of a prepared statement before its total time for execution catches up with a statement. When it es to which SQL statement object performs better under typical use, a Statement or a PreparedStatement, the truth is that the Statement object yields the best performance. When you consider how SQL statements are typically used in an application1 or 2 here, maybe 1020 (rarely more) per transactionyou realize that a Statement object will perform them in less time than a PreparedStatement object. In the next two sections, we39。s not interesting enough to write home about, it does demonstrate how automit can impact performance.Table 191: Automit timings (in milliseconds)AutomitOCIThinOn3,7123,675Off2,6132,594Clearly, it39。alter table TestXXXPerfadd constraint TestXXXPerf_Pkprimary key ( id )using indextablespace users pctfree 20storage( initial 1 M next 1 M pctincrease 0 )。m sure you39。ll also examine the performance of the OCI versus the Thin driver in each situation to see if, as Oracle39。ll examine the relative performance of various JDBC objects using example programs that report the amount of time it takes to acplish a given task. We39。原文一:Java Programming with Oracle JDBC:PerformancePerformance is usually considered an issue at the end of a development cycle when it should really be considered from the , a task called performance tuning is done after the coding is plete, and the end user of a program plains about how long it takes the program to plete a particular net result of waiting until the end of the development cycle to consider performance includes the expense of the additional time required to recode a program to improve its 39。s optimizer plans to execute your SQL statements. Armed with this knowledge, you may determine that additional indexes are needed, or that you require an alternative means of selecting the data you desire.On the other hand, when it es to using JDBC, you need to know ahead of time the relative strengths and weaknesses of using automit, SQL92 syntax, and a Statement versus a PreparedStatement versus a CallableStatement object. In this chapter, we39。ll start a series of parisons of the Statement object versus the PreparedStatement object versus the CallableStatement object. At the same time we39。ll only talk about them. Although the actual timing values change from system to system, their relative values, or ratios from one system to another, remain consistent. The timings used in this chapter were gathered using Wind
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1