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 9208051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:31:54+00:00 2026-06-18T00:31:54+00:00

I have a simple piece of code I have been working on : import

  • 0

I have a simple piece of code I have been working on :

import java.sql.*;

class ODBC  
{
MyConnection myCon;
Connection jdbcConnection;
ResultSet rs;
String sql;
PreparedStatement stmt;

public ODBC() throws Exception {
    init();
}

public void init() throws Exception{
    myCon = new MyConnection();     
    jdbcConnection = myCon.getConnection();
}

public void runQuery() throws SQLException {
    sql = "SELECT DISTINCT HELPDESK_CASE.INCIDENT_NUMBER, "
            + "HPD_AUDIT.AUDIT_DATE, HPD_AUDIT.AUDIT_FIELD, "
            + "HELPDESK_CASE.DETAILED_DESCRIPTION, "
            + "HPD_AUDIT.AFTER_VALUE, "
            + "HELPDESK_CASE.DESCRIPTION "
            + "FROM HELPDESK_CASE INNER JOIN "
            + "HPD_AUDIT ON HELPDESK_CASE.INCIDENT_NUMBER "
            + "= HPD_AUDIT.INCIDENT_NUMBER "
            + "WHERE (((HELPDESK_CASE.INCIDENT_NUMBER)='INC001001837949') "
            + "AND ((HPD_AUDIT.AUDIT_FIELD)='Assigned Group')) "
            + "ORDER BY HELPDESK_CASE.INCIDENT_NUMBER, "
            + "HPD_AUDIT.AUDIT_DATE"; 
    stmt = jdbcConnection.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE );
    rs = stmt.executeQuery();
    while(rs.next()){
        System.out.println("Something is here");
    }
}

public static void main (String args[]) throws Exception 
{
    ODBC odbc;
    odbc = new ODBC();
    odbc.runQuery();
}

class MyConnection {
    public Connection getConnection() throws Exception 
    {
        String URL = "jdbc:odbc:corpp05";
        Connection c = DriverManager.getConnection(URL, "remro", "*****"); 
        return c;
    }
}
}

I cannot figure out the following behavior.

  1. I run this query in MySQL as well as Access using the same JDBC driver and they return nothing (as they should return NOTHING as the incident number being queried does not exist).
  2. I need the ability in other areas of this program (outside of this sample snip) to call resultSet.previous() resultSet.beforeFirst() etc. and therefor need to be able to SCROLL forwards and backwards.
  3. When I use the preparedStatement as follows:

    stmt = jdbcConnection.prepareStatement(sql);

The while loop is never executed as is expected behavior but when I use the preparedStatement as follows:

stmt = jdbcConnection.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE );

(Which I need since I need the TYPE_SCROLL_INSENSITIVE) The while loop IS executed and “Something is here” is printed.

What am I missing here? I feel like it is relatively obvious I need to just take a step back and have other eyes on this I believe. Appreciate the help.

Cmres

  • 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-18T00:31:55+00:00Added an answer on June 18, 2026 at 12:31 am

    Download thin driver from oracle site most suitable for the version of oracle that you are using. Add that jar file in the eclipse external jar files archive.
    After all set up is done:
    you can make connection as follows:

    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());                         
    con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","user","****"); 
    

    Since jdbc.getTransactionIsolation() returns 2 in your case so the possibility of dirty reads is eliminated.

    I hope changing driver would solve your problem.

    EDIT
    Read here about the JDBC-ODBC driver as postulated on Oracle Website . After some line while describing about JDBC-ODBC driver it tells the following cons:

    Cons: Not for large-scale applications. Performance suffers because
    there’s some overhead associated with the translation work to go from
    JDBC to ODBC. Doesn’t support all the features of Java. User is
    limited by the functionality of the underlying ODBC driver.

    So it provides enough reason to believe that some critical issues might suffer when the application is solely based on JDBC-ODBC driver for implementing database transactions or other important database functionality via the sensitive API provided by java.sql package.

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

Sidebar

Related Questions

I have a rather simple piece of code that is hanging in java. The
I have this simple piece of code : int a = 1, b =
I have very simple piece of code. The goal is when i input four-digit
I have a simple piece of code: txtRequiredDate.setText(wwDateFormatter.format(todoEntity.getRequiredDate())); txtRequiredDateDay.setText(dayOfWeek(todoEntity.getRequiredDate())); txtDoneDate.setText(wwDateFormatter.format(todoEntity.getDoneDate())); txtDoneDateDay.setText(dayOfWeek(todoEntity.getDoneDate())); Problem is that
I have this simple piece of code: MyObjectContext db = new MyObjectContext(); Person new_person
I have a simple piece of c++ code: #include <iostream> using namespace std; int
I have a simple piece of Javascript code and I get this Error :
I have a very simple piece of code and it reads characters from files.
I have this simple piece of HTML code: <div> <input type=file name=english-file /> </div>
I have a very simple piece of code: #include <stdio.h> #include <glib.h> int main(int

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.