Unable to connect to the database using Hikari connection pool - java

I wish to use Hikari Connection Pool in my Spring application to connect to the Oracle Database
Below is the connection string
JDBC URL:
jdbc:oracle:thin:#ldaps://abc-def-dmz.demo.com:876/SOM_APP,cn=oraclecontext,dc=demo,dc=com
Getting the following error
Error Message: Failed to initialize pool: IO Error: JNDI Package
failure javax.naming.CommunicationException: localhost:876[Root
exception is java.net.ConnectException: Connection refused: connect]
How do I fix this?

java.net.ConnectException: Connection refused: connect
The error implies that your connection is being blocked, most likely by a firewall. Check with your DBA and system or network administrators to make sure the network path to the server is open, and that you are using the right port numbers.

Related

OpenDS server not starting getting port error

can any one can help with this?
When i am trying to install Opends got below error
server not starting
WARNING: Could not connect to server: javax.naming.CommunicationException: 0.0.0.0:4444 [Root exception is java.net.ConnectException: Connection refused: connect]
javax.naming.CommunicationException: 0.0.0.0:4444 [Root exception is java.net.ConnectException: Connection refused: connect]
Could not connect to the server after requesting start. If you have a firewall configured check that it allows connections to port 4444. org.opends.quicksetup.util.ServerController.startServer(ServerController.java:511) org.opends.quicksetup.util.ServerController.startServer(ServerController.java:292) org.opends.quicksetup.installer.offline.OfflineInstaller.run(OfflineInstaller.java:142) java.lang.Thread.run(Unknown Source)
This error happens when there is already an application that uses the port 4444 on the machine.
What is your platform ?
Btw, do you know that OpenDS was last released in 2010 ? You might want to look at OpenDJ for newer and more up to date versions.

Connection String of MS-SQL to put in JAVA

What should be the connection string for MSSQL Database in JAVA? Something like this.
Like someother things I want to know that Is there any password in connection string like password of my computer? what should be the port number, url etc? If you need more information about the connection let me know.
P.S. The black line has the servername.
My Connection values
datasource.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
datasource.url=jdbc:sqlserver://MSSQLSERVERFULL;databaseName=xproctor;
datasource.user=JUNAID-VAIO\Shamim
datasource.password=
ERROR:
here is the ERROR I get while trying to connect database!!
Error querying database. Cause:
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not
get JDBC Connection; nested exception is
org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (The TCP/IP connection to the host
MSSQLSERVERFULL, port 1433 has failed. Error: "null. Verify the
connection properties. Make sure that an instance of SQL Server is
running on the host and accepting TCP/IP connections at the port. Make
sure that TCP connections to the port are not blocked by a
firewall.".)
Use this connection string:
jdbc:sqlserver://;servername=server_name;integratedSecurity=true;authenticationScheme=JavaKerberos
The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect".
Enable Name pipes, TCP/IP, change Authentication mode, change localhost to 127.0.0.1 or .,
add the Instance Name to the url, change the port, enable port and Apps in the firewall... almost everything.
Its horrible! But the answer for your problem is: open SQL Server Configuration Manager -> Protocols for SQL SQLEXPRESS, select Properties of TCP/IP. In the tab IP Addresses, set the TCPPort in section IPAll to 1433.

Can't connect to remote database with JDBC

I have a database on external server with Cpanel. I've made database and all I know is that this is database adress: server: pgsql1.superhost.pl
I tried to connect like this:
connection = DriverManager.getConnection(
"jdbc:postgresql://sql1.superhost.pl:5432/database_name",
"user_name", "password");
I tried without port, I tried everything, but I'm still getting error:
org.postgresql.util.PSQLException: at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:233)
....
Caused by: java.net.UnknownHostException: sql1.superhost.pl

Could not create oracle database connection from jboss

During my development, server(jboss4.0) was restarted because of some changes in java source and server failed to restart with the below stacktrace.
[JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=186647552)(ERR=12514)(ERROR_STACK=(ERROR=(CODE=12514)(EMFI=4)))))
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:179)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:565)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:250)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:491)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:341)
at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:301)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1881)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1174)
Caused by: java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=186647552)(ERR=12514)(ERROR_STACK=(ERROR=(CODE=12514)(EMFI=4))))
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:404)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:171)
... 150 more
17:51:19,271 WARN [SettingsFactory] Could not obtain connection metadata
org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=
I have even successfully tested connection with a standalone java program and with ping. Also it is connecting from my oracle sql developer. I'm using oracle 9i.
What could be the reason as its suddenly getting into this error?

java.sql.SQLException encountered when connecting to Oracle database

I get the following error when I try to run my project:
java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=169870080)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
Any ideas?
You're getting an ORA-12505 error ("TNS: listener could not resolve SID given in connection description."). This happens when the SID (System ID) of the database you wish to connect to isn't registered with Oracle's listener. If you can find the JDBC connection information, you may find something that matches this pattern:
jdbc:oracle:thin:[user]/[password]#[host]:[port]:[sid]
In this case, Oracle is telling you that [sid] does not exist on the server [host]. You may be connecting to the wrong server.
Connection refused means that the server is not allowing your client to connect. Double check the server settings and make sure your host is allowed to connect, at the very least.

Categories

Resources