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

  • Home
  • SEARCH
  • 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 111907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:27:40+00:00 2026-05-11T02:27:40+00:00

While trying to connect to a database that’s set to read only, the connection

  • 0

While trying to connect to a database that’s set to read only, the connection cannot be made. I get the following error:

Cannot create PoolableConnectionFactory (Io exception: The Network Adapter could not  establish the connection) 

The application needs to run in read-write mode and then automatically handle the switch to read-only by only checking the isReadOnly property of the connection object. The application runs correctly when connecting to a read-write database, but fails when I change to the connection string below (with security information removed). I’ve verified that the connection string is correct, so the problem doesn’t lie there.

ca.businesssolutions.nbs.jdbc.connect=jdbc:oracle:thin:unicorn_read_only/password@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=9999)))(CONNECT_DATA=(SID=SBSBTST)(SERVER=DEDICATED))) 

I’m having trouble trying to figure out where to start looking. I inherited the application and am not sure if it’s a spring framework limitation or another setting I’m missing.

The spring configuration for the datasource is:

<bean id='dataSource' class='ca.businesssolutions.nbs.server.base.datasource.MyBasicDataSource'       destroy-method='close'>     <!--url and driver class name are set through Configuratoin object.-->     <property name='initialSize' value='10'/>     <property name='maxActive' value='-1'/>     <property name='validationQuery' value='SELECT 1 FROM DUAL'/>     <property name='accessToUnderlyingConnectionAllowed' value='true'/> </bean> 

The Data Source constructor:

public MyBasicDataSource() {     super();     setUrl(Configuration.get(Configuration.CONNECT));     setDriverClassName(Configuration.get(Configuration.DRIVER_NAME));     //The initial number of connections that are created when the pool is started.     int numConnections = 10;     try {         numConnections = Integer.parseInt(Configuration.get(Configuration.NUMBER_OF_CONNECTIONS));     } catch (Exception exception) {         // Do nothing.     }     setInitialSize(numConnections);     //The maximum number of active connections that can be allocated from this pool at the same time, or non-positive for no limit.     setMaxActive(-1);     setValidationQuery('SELECT 1 FROM DUAL');     setAccessToUnderlyingConnectionAllowed(true);     DataAccessObject.setDataSource(this); } 

What else would help?

  • 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. 2026-05-11T02:27:40+00:00Added an answer on May 11, 2026 at 2:27 am

    What’s the difference between read/write and read-only connect string? Is there any chance for a typo? Have you tried this connect string from another tool (but from the same host)? Try using a Java GUI Tool on the same computer that you have difficulties connecting from. Use Copy/Paste with your exact connection string.

    If this doesn’t work either, you might have an unresolvable hostname, firewall issues or something else. If it does work from the same computer leave a comment.

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

Sidebar

Related Questions

I'm receiving this error while I'm trying to connect to a database from a
I am trying to connect to the database and get current state of a
I am trying to run the following. <?php $db = mysqli_connect(localhost,user,pw) or die(Database error);
I'm trying to get an id from the users database so that I can
Sorry answer found while typing I am trying to connect to an external webservice
While trying to generate classes from a xsd, i got this error: java.lang.IllegalArgumentException: Illegal
I've ran into a problem while trying to test following IRepository based on NHibernate:
I got an error today while trying to do some formatting to existing code.
I'm trying to connect to SQLite database with Ecplise but I have some errors.
I am trying to connect my iPhone aap directly to the MySQL database. I

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.