Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7743629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:35:01+00:00 2026-06-01T09:35:01+00:00

i’m doing my first applications using JDBC/Oracle… Today i had a problem and i

  • 0

i’m doing my first applications using JDBC/Oracle…
Today i had a problem and i can’t find out what’s wrong.

That’s my code (some parts)

My global variables:

public class Esercizio02_GestioneDB {

public Esercizio02_GestioneDB(){

}

public Connection conn = null;
public Statement s = null;
public ResultSet rs = null;
public ResultSet rs1 = null;
ResultSetMetaData rsmd = null;
ResultSetMetaData rsmd1 = null;

[...]

My connection method:

public void connetti(String user, String pwd) throws ClassNotFoundException, SQLException {

        //DRIVER
        Class.forName("oracle.jdbc.driver.OracleDriver");

        //URL
        String url = "jdbc:oracle:thin:@//localhost:1521/xe";

        //CONNECTION
        conn = DriverManager.getConnection(url, user, pwd);

        //AUTOCOMMIT
        conn.setAutoCommit(true);

        //STATEMENT
        s = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,    ResultSet.CONCUR_UPDATABLE);         


}

So, i have a method to delete a row in a table:

private void eliminaPrenotazione() {

    try {

        String message1 = "Scegli la prenotazione da cancellare:\n\n";

        String query = "SELECT * FROM camere_prenotate";

        rs1 = s.executeQuery(query);
        rsmd1 = rs1.getMetaData();

        message1 += "INDICE ";
        for (int i=1; i<=rsmd1.getColumnCount(); i++) {
            message1 += rsmd1.getColumnName(i);
            message1 += " \t ";
        }
        message1 += "\n_______________________________\n";

        int rowIndex = 1;
        String columnType = "";
        while (rs1.next()) {    
            message1 += "["+rowIndex+"]. ";
            rowIndex++;

            for (int i=1; i<=rsmd1.getColumnCount(); i++) {

                columnType = rsmd1.getColumnTypeName(i);

                if(columnType.substring(0, 3).equalsIgnoreCase("num")) message1 += rs1.getInt(i);
                if(columnType.substring(0, 3).equalsIgnoreCase("var") || columnType.substring(0, 3).equalsIgnoreCase("dat"))
                        message1 += rs1.getString(i);

                message1 += " \t ";
            }
            message1 +="\n";
        }
        message1 +="\n";

        String scelta = JOptionPane.showInputDialog(null, message1);
        int sceltaInt = Integer.parseInt(scelta);

        rs1.absolute(sceltaInt);
        rs1.deleteRow();



    } catch (Exception e) {

        JOptionPane.showMessageDialog(null, "Errore: " + e.getMessage());
    }

}

deleteRow() returns me an error… it says me that my ResultSet is read only, but in my statement it’s delcared as

s = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);

so, what’s wrong?

sry for the noobish code and the bad english -.-”’

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:35:02+00:00Added an answer on June 1, 2026 at 9:35 am

    select * makes the Resultset instance readonly.
    select COLUMNNAME makes it updatable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am doing a simple coin flipping experiment for class that involves flipping a
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
Seemingly simple, but I cannot find anything relevant on the web. What is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.