Updating Specific rows in java sqlite using netbeans

383
August 20, 2017, at 2:24 PM

Hello I am trying to update specific rows in java. I want the rows that only have admin code and same economic code to be updated also, I want it to get sum of payment before that row and combine it in one place

    try {
        String madalla = String.valueOf(txt_admin.getText());
        String sosai = String.valueOf(txt_econo.getText());
        String hello = "Select sum(paymentcurrent), paymentprevious, rowid from MPA1 where (econcd == '" + sosai + "' and admincd == '" + madalla + "' and rowid <= 1)";
        pst = conn.prepareStatement(hello);
        rs = pst.executeQuery();
        if (rs.next()) {
            String sum = rs.getString("sum(paymentcurrent)");
            double hmm = Double.valueOf(sum);
            double hankuri = Double.parseDouble(txt_previous.getText());
            Double testing = Double.sum(hmm, hankuri);
            String trying = String.format("%.2f", testing);
            String kaai = String.valueOf(hmm);
            String finale = String.valueOf(trying);
            String value4 = txt_admin.getText();

            String value2 = txt_econo.getText();
            String sql = "update MPA1 set total = '" + kaai + "', cumulativereceipt = '" + finale + "'  where (econcd = '" + value2 + "' and admincd == '" + value4 + "' and rowid = 1)";
        }
    }
Rent Charter Buses Company
READ ALSO
Name of individual arrays created in for loop

Name of individual arrays created in for loop

I have created 5 arrays using this code:

190
How to create a &ldquo;Game Option/Pause Screen&rdquo; in Swing?

How to create a “Game Option/Pause Screen” in Swing?

Background: Making a game in SwingIt is simple turn base game

284
Maven not found in Jenkins

Maven not found in Jenkins

I am running my Maven/Spring project in Jenkins (just testing it out, first time) using the shell script option with:

1318
Is it bad practice to use default common fork/join pool with CompletableFuture for doing long blocking calls?

Is it bad practice to use default common fork/join pool with CompletableFuture for doing long blocking calls?

Lets say I have a CompletableFuture which wraps a blocking call like querying a backend using JDBCIn this case, since I am not passing any executor service as a parameter to CompletableFuture

268