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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:14:21+00:00 2026-06-03T03:14:21+00:00

I’m trying to use oracle after using mysql and have a question about getting

  • 0

I’m trying to use oracle after using mysql and have a question about getting info from db tables. Here what I have.

PreparedStatement statement = null;
    ResultSet resultSet = null;

    List<News> newsList = new ArrayList<News>();

    try {
        statement = connection.
        prepareStatement(NewsSQLQueryContainer.GET_NEWS_LIST);

        resultSet = statement.executeQuery();
        while (resultSet.next()) {
            News news = new News();
            news.setIdNews(resultSet.getInt("idnews"));
            news.setInfo(resultSet.getString("info"));
            news.setNewsDate(resultSet.getDate("newsdate"));
            news.setNewsHeader(resultSet.getString("newsheader"));
            newsList.add(news);
            }
    }

and connection is received from my own pool, which initialize this way:

public static void init() throws DAOException{
    if(instatance == null){

        ResourceBundle rb = ResourceBundle.getBundle(PROPERTIES_FILENAME);
        String driver  = rb.getString("DATABASE_DRIVER_NAME");
        String url = rb.getString("DATABASE_URL");
        String user = rb.getString("DATABASE_USER");
        String password = rb.getString("DATABASE_PASSWORD");
        String poolSizeStr = rb.getString("DATABASE_POOLSIZE");
        int poolSize = (poolSizeStr != null) ?
                Integer.parseInt(poolSizeStr) : DEFAULT_POOL_SIZE;

        log.info("Trying to create pool of connections...");

        instatance = new ConnectionPool(driver,url,user,password,poolSize);

        log.info("Connection pool initialized");
}

from this properties file:

DATABASE_DRIVER_NAME=oracle.jdbc.driver.OracleDriver
DATABASE_URL=jdbc:oracle:thin:@localhost:1521:ORCL
DATABASE_USER=root
DATABASE_PASSWORD=root
DATABASE_POOLSIZE=40

almost the same code worked with mysql and don’t work now(gets nothing to result set). Is there any special approach with getting info from oracle?

Fixed it: just forgot that this user don’t have such rights with this db

  • 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-03T03:14:22+00:00Added an answer on June 3, 2026 at 3:14 am

    I don’t think the problem you are having is to do with any difference between getting info from Oracle tables compared with MySQL tables.
    There doesn’t look to be anything wrong with the way you are retrieving the result set (although it would be interesting to see the query contained in NewsSQLQueryContainer.GET_NEWS_LIST).
    Sorry for the obvious question – does your table contain any data?!

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
For some reason, after submitting a string like this Jack’s Spindle from a text
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 have a text area in my form which accepts all possible characters from
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have thousands of HTML files to process using Groovy/Java and I need to
I am trying to loop through a bunch of documents I have to put
I have a bunch of posts stored in text files formatted in yaml/textile (from

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.