I am trying to connect to Teradata from my spring boot project. But I am constantly getting unknown host exception. When I do Test Net Connection from Power shell, TCP Test Succeeded comes as true. Also I am able to connect to the Teradata from Teradata SQL assistant. Below is config from application config file. Properties in <> removed for security reason. the Teradata we have is via LDAP authentication
spring:
jpa:
show-sql: true
database-platform: org.hibernate.dialect.TeradataDialect
datasource:
driverClassName: com.teradata.jdbc.TeraDriver
url: jdbc:teradata://:/LOGMECH=LDAP,database=,charset=ASCII,tmode=ANSI
username:
password:
Exception is below: ( values in <> removed for security reason)
java.sql.SQLException: [Teradata JDBC Driver] [TeraJDBC 16.20.00.13] [Error 1000] [SQLState 08S01] Login failure for Connection to :1025 Tue Jul 05 23:12:11 CEST 2022 socket orig=:1025 cid=6007091b sess=0 java.net.UnknownHostException: HOSTNAME :1025
Related
I am trying to connect to a rabitmq from a springbok app with a newly created user on rabbitmq but according to logs the app is always trying to connect with the default guest user
the rabbitmq logs
2019-02-13 00:12:38.860 [error] <0.1318.0> Error on AMQP connection <0.1318.0> (192.168.1.185:60124 -> 192.168.1.185:5672, state: starting):
PLAIN login refused: user 'guest' can only connect via localhost
the yaml spring boot app config
spring:
rabbitmq:
host: 111.111.111.111
port: 5672
username: user1
password: user1
connectionName: com.test.user
the spring boot error log
Caused by: com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:362)
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1104)
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1054)
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1218)
at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:471)
... 10 common frames omitted
In the springboot app, under resources, you may create one application.properties file and configure the following information.
spring.rabbitmq.host=111.111.111.111
spring.rabbitmq.port=5672
spring.rabbitmq.username=user1
spring.rabbitmq.password=user1
you may write as:
rabbitmq:
config:
host: 111.111.111.111
port: 5672
username: user1
password: user1
connectionName: com.test.user
I am trying to create new datasource in the Weblogic 12c (version: 12.2.1.3.0).
Below are the details of the databasource:
Name: TestDataSource
JNDI Name: jdbc/test.data
DatabaseType: Oracle
Database Driver: Oracle's Driver (Thin XA) for Instance
connections; Verions: Any
Database Name: XXXX
Host Name: xxxxxx
Port: 1521
Database User Name: XXXX
Password: XXXX
Driver Class Name: oracle.jdbc.OracleDriver
Select Targets: serverName
After saving I am getting below exception:
oracle.net.ns.NetException: Listener refused the connection with the following error: ORA-12519, TNS:no appropriate service handler found
Substituted for the exception oracle.net.ns.NetException which lacks a String contructor, original message - Listener refused the connection with the following error: ORA-12519, TNS:no appropriate service handler found
I am able to connect to the same database via SQLDeveloper without any error.
Please let me know if I am missing any property or step while setup.
after restarting operating system (aix) I am not able to connect to locally installed oracle db from my application.
connected to sqlplus and executed startup command.
Select statements working fine from sqlplus. Should we start listener separately?
But the application fails with:
Error:
IO Error: The Network Adapter could not establish the connection
Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.1.v20150916-55dc7c3): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection
I'm trying to open a read-only Derby database over a network client connection (using ij / derbyclient.jar).
I have created a read-only database:
jar cMf sample.jar sample
The Derby Network Server is started.
I have tried the following connection URLs:
connect 'jdbc:derby:jar://localhost:1527/sample.jar';
connect 'jdbc:derby:jar://localhost:1527/(sample.jar)sample';
connect 'jdbc:derby://localhost:1527/jar:(sample.jar)sample';
But none of the above URLs work.
The only URL that works is:
connect 'jdbc:derby:jar:(sample.jar)sample';
It appears that read-only Derby databases can only be opened in embedded mode. Is this true ?
Solved:
After checking the "derby.log", the problem was that the read-only database needs to be able to create a temporary file.
derby.log:
java.sql.SQLException: Failed to start database 'jar:(sample.jar)sample' with class loader sun.misc.Launcher$AppClassLoader#1d450337, see the next exception for details.
...
Caused by: java.sql.SQLException: Failed to start database 'jar:(sample.jar)sample' with class loader sun.misc.Launcher$AppClassLoader#1d450337, see the next exception for details.
...
Caused by: java.sql.SQLException: Java exception: 'Unable to create temporary file: java.lang.SecurityException'.
...
Caused by: java.lang.SecurityException: Unable to create temporary file
The solution is to define a temporary directory for the database. This can be done with the "derby.storage.tempDirectory" property:
System-wide in "derby.properties":
derby.storage.tempDirectory=c:/temp
Database-wide
CallableStatement cs =
conn.prepareCall("CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?, ?)");
cs.setString(1, "derby.storage.tempDirectory");
cs.setString(2, "c:/temp");
cs.execute();
cs.close();
The network URL is:
connect 'jdbc:derby://localhost:1527/jar:(sample.jar)sample';
I'm struggling for two hours to deploy an application on Jboss server which connects to my Oracle DB.
The dbname-ds.xml has:
<datasources>
<local-tx-datasource>
<jndi-name>dbnameDatasource</jndi-name>
<use-java-context>false</use-java-context>
<connection-url>jdbc:oracle:thin:#192.168.168.105:1521:XE</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>system</user-name>
<password>password</password>
</local-tx-datasource>
</datasources>
The credentials are ok because I've tested them using DataBase home page tool from Oracle.
The error I receive in jboss is:
00:14:28,383 INFO [ConnectionProviderFactory] Initializing connection provider:
org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
00:14:28,389 INFO [InjectedDataSourceConnectionProvider] Using provided datasou
rce
00:14:49,476 WARN [JBossManagedConnectionPool] Throwable while attempting to ge
t a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested
throwable: (java.sql.SQLException: Io exception: The Network Adapter could not
establish the connection)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.g
etLocalManagedConnection(LocalManagedConnectionFactory.java:225)
//etc
and caused by:
Caused by: java.sql.SQLException: Io exception: The Network Adapter could not es
tablish the connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
Do you have any idea where to look?
I've also modified the default localhost to be my ip from ds file:
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.168.105)(PORT = 1521))
so the host and port is correct.
What else can be the cause...?
Thanks a lot...