I wanted to start the topic for the "Expert Oracle JDBC Programming" book promotion and ask a question that I have been toiling with for a while.
I first learned databases and SQL and then I gained more extensive knowledge of Java, so my initial impetus on any type of web/database development project is to put a lot of business logic in the database.
I understand the implications of doing that are tremendous if the system is to be flexible and distributed or if at some point of its lifecycle it has to accomodate data from a completely different RDBMS the price of my design decision may be very high. That and the fact that I want to be DB implementation independent has forced me to move a lot of my business logic outside of the db, but I know that in some situations performance using stored procedures on the DB side would lead to tremendous gains.
I was wondering if there is any special measure to define where is the line to choose between similiar functionality on both ends, that would help me choose Stored Procedures over a Java class implementation.I would like to ask the author to comment on the subject and give us his thoughts as to what situation or consideration we should have in mind when dealing with Oracle JDBC. Specific examples are greatly encouraged .
I realize that PreparedStatements can be a performance win (because they get parsed once and then don't get recompiled) but I'm puzzled by their use in batching large number of inserts or updates. Is it cleaner to use the standard JDBC batching (addBatch/executeBatch) or is there enough of a performance boost to make Oracle's way (setExecuteBatch) worth it? And wouldn't it take really large batches to see a difference? And how does this interact with connection pooling?
Another aspect is that middle tier is more scalble than scaling the database. Say your demand increases from 100 concurrent clients to 500 concurrent clients on the web, you can add another middle tier server to scale your application. But if you have lot of your code going through the Database stored proc then your Database server will become a bottle-neck.
The government thinks you are too stupid to make your own lightbulb choices. But this tiny ad thinks you are smart:
Java file APIs (DOC, XLS, PDF, and many more)https://products.aspose.com/total/java