[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

Bulk updates in SYBASE using Java Batch Updates

Asked by farhanitman in Sybase Database, Java Standard Edition, Java Programming Language

Tags: sybase, sql, query, java

I have to execute many updates on a table using java batch updates, but i when i try to execute my code on 22,000 records, it just hangs.

How can i optimize the updates to not use NOARCHIVELOG, as in Oracle database. How can i make my updates faster?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
String updateSql = "UPDATE AMF " +
                    " SET BLOCKED_CV = ?, " +
                    " BLOCKED_FC = ? " +
                    " WHERE BRANCH_CODE = ? " +
                    " AND CURRENCY_CODE = ? " +
                    " AND GL_CODE = ? " +
                    " AND CIF_SUB_NO = ? " +
                    " AND SL_NO = ? ";
            statement = conn.prepareStatement(updateSql);
            if (totalColumns > 0) {
                //Now writing records in csv file
                for (int r = 0; r < totalRows; r++) {
 
                    rowVector = (Vector) IADataVector.get(r);
                    // only update those blocked amounts which exists on imal side
                    if (rowVector.get(INDEX_PIBAS_ADDREF) != null &&
                            rowVector.get(INDEX_IMAL_ADDREF) != null) {
 
                        //System.out.println("updateRows= " + updateRows);
 
                        blockAmount = new Double(rowVector.get(INDEX_PIBAS_SHDWBALN).toString()).doubleValue();
                        branch = new Integer(rowVector.get(INDEX_IMAL_BRANCH).toString()).intValue();
                        currency = new Integer(rowVector.get(INDEX_IMAL_CURRENCY).toString()).intValue();
                        glCode = new Long(rowVector.get(INDEX_IMAL_GL).toString()).longValue();
                        cifNo = new Long(rowVector.get(INDEX_IMAL_CIF).toString()).longValue();
                        slNO = new Integer(rowVector.get(INDEX_IMAL_SL).toString()).intValue();
 
                        if (currency == 586) {
                            statement.setDouble(1, blockAmount);
                            statement.setLong(2, 0);
                        } else {
                            statement.setLong(1, 0);
                            statement.setDouble(2, blockAmount);
                        }
                        statement.setInt(3, branch);
                        statement.setInt(4, currency);
                        statement.setLong(5, glCode);
                        statement.setLong(6, cifNo);
                        statement.setInt(7, slNO);
 
                        statement.addBatch();
                    }
                    updateRows++;
                }
                statement.executeBatch();
            }
            statement.close();
            conn.commit();
[+][-]02/21/09 02:37 AM, ID: 23699417Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/21/09 02:54 AM, ID: 23699462Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/21/09 02:57 AM, ID: 23699470Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/21/09 02:58 AM, ID: 23699475Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/21/09 09:10 AM, ID: 23700666Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/22/09 07:58 PM, ID: 23708112Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/22/09 08:24 PM, ID: 23708220Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/23/09 09:18 AM, ID: 23713446Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/23/09 08:58 PM, ID: 23718410Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/23/09 09:02 PM, ID: 23718425Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/23/09 09:51 PM, ID: 23718625Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/23/09 11:38 PM, ID: 23719092Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/23/09 11:41 PM, ID: 23719109Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/23/09 11:42 PM, ID: 23719116Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/24/09 08:47 AM, ID: 23723382Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/25/09 02:15 AM, ID: 23731996Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/25/09 09:35 AM, ID: 23736167Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/26/09 10:02 PM, ID: 23753080Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/26/09 10:29 PM, ID: 23753187Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/27/09 08:34 AM, ID: 23757166Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/27/09 08:42 PM, ID: 23761806Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/28/09 07:36 AM, ID: 23764080Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/03/09 02:08 AM, ID: 23782305Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/03/09 08:08 AM, ID: 23785124Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/03/09 09:23 PM, ID: 23791914Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/03/09 10:29 PM, ID: 23792123Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/04/09 06:55 AM, ID: 23795253Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Sybase Database, Java Standard Edition, Java Programming Language
Tags: sybase, sql, query, java
Sign Up Now!
Solution Provided By: grant300
Participating Experts: 2
Solution Grade: A
 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625