JBAS010447: Connection is not valid - oracle

I need help, when i try to create a datasource connection on jboss show this error JBAS010447: Connection is not valid
my connection url is jdbc:oracle:thin:#//localhost:1521/ORCL
on my jboss log show ORA-28040: No matching authentication protocol

I think your JDBC driver and Oracle Database version are not suitable. Please check your ojdbc.jar Check this link

Related

Does Hikari Connection need test connection when starts the application?

I configured Hikari following this tutorial: https://www.baeldung.com/spring-boot-hikari
When Spring Boot starts Hikari starts too, as follows in the next image:
Is it possible to configure Hikari to start when the first ReST request is being received?
Quoted from Hikari's official document on Github:
connectionTestQuery
If your driver supports JDBC4 we strongly recommend not setting this property. This is for "legacy" drivers that do not support the JDBC4
Connection.isValid() API. This is the query that will be executed just
before a connection is given to you from the pool to validate that the
connection to the database is still alive. Again, try running the pool
without this property, HikariCP will log an error if your driver is
not JDBC4 compliant to let you know. Default: none
As documentation:
"For a pooling DataSource to be created, we need to be able to verify that a valid Driver class is available, so we check for that before doing anything. In other words, if you set spring.datasource.driver-class-name=com.mysql.jdbc.Driver, then that class has to be loadable."(https://docs.spring.io/spring-boot/docs/2.1.6.RELEASE/reference/htmlsingle/)

Connecting to Oracle12C database using standalone java client Vs Connecting through Websphere

Connection to Oracle 12c from a standalone java application succeeds when ojdbc6.jar or ojdbc5.jar is used.
Connection String : jdbc:oracle:thin:#serverName:port:sid
Whereas the same connection string fails when connecting through Websphere with the following exception.
java.sql.SQLException: ORA-28040: No matching authentication protocol
DSRA0010E: SQL State = 99999, Error Code = 28,040
Note : Tried ojdbc8.jar and ojdbc6.jar
The ORA-28040: No matching authentication protocol error generally indicates that you are using an older JDBC driver with a newer database. You should either update your JDBC driver so that it is the same version as the database or update your sqlnet.ora file with the appropriate SQLNET.ALLOWED_LOGON_VERSION_SERVER/SQLNET.ALLOWED_LOGON_VERSION_CLIENT values. See Oracle's SQLNET documentation for more information.
Note that if you think you are using the same version JDBC driver as the database it is possible that a different JDBC driver is being picked up in the WebSphere environment. If that is the case:
Check that there are no additional JDBC drivers packaged with your application.
Check if there are other Oracle JDBC Providers configured in WebSphere using an older JDBC driver. If so either modify your configuration so all of your providers are using the same version Oracle JDBC driver or you will need to Isolate your JDBC Providers.

How to connect to Teradata using SoapUI? What are the configuration details for SoapUI-Teradata connection?

I want to add a test step in Soap UI Test Case, wherein I can connect to Teradata database and fire a query to validate.
However, I am facing issues while setting up the configuration for the connection.
In the configuration details, I have provided as below:
Driver: com.teradata.jdbc.TeraDriver
Connection String: jdbc:teradata:
Below is the error thrown on TEST CONNECTION:
Can't get the Connection for specified properties; java.sql.SQLException:
[Teradata JDBC Driver] [TeraJDBC 15.10.00.35] [Error 1032] [SQLState HY000]
Single Sign-On NOT supported for Mechanism TD2.
Note:
1. I have NOT added any properties(Name/Value).
2. SoapUI 5.3.0. (Free) version.
3. Teradata drivers(terajdbc4, tdjssconfig jars) are added in ../SmartBear/SoapUI-5.3.0/bin/ext/
I figured it out. Here is the solution.
Driver=com.teradata.jdbc.TeraDriver
Connection String=jdbc:teradata://servername/USER=username,PASSWORD=password
The issue was with incorrect syntax for Connection String.
Thanks all for your inputs!

How do I connect to cockroachDB through JDBC from logstash output plugin?

I am using logstash to create a pipeline from Postgres to CockroachDB. Below is the config.
The input plugin(source is postgres) is working fine. But I am unable to establish a connection in the output plugin(cockroachDB) using JDBC. I am facing the below error.
JDBC - Connection is not valid. Please check connection string or that your JDBC endpoint is available. {:level=>:error, :file=>"logstash/outputs/jdbc.rb", :line=>"154", :method=>"setup_and_test_pool!"}
Destination(cockroachDB) is open for connection at the specified ip and port.
As cockroachDB JDBC connection string is very similar to postgres, I tried the below connection strings, and still the same error.
jdbc:postgresql://host/database
jdbc:postgresql://host/database?sslmode=disable
jdbc:postgresql://host:port/database
jdbc:postgresql://host:port/database?sslmode=disable
How do I connect to cockroachDB through JDBC from logstash output plugin?
Your JDBC connection strings are OK.
Do not forget with JDBC the driver must be registered beforehand. You can do this either with Class.forName("org.postgresql.Driver") before your first JDBC class or invoke java.sql.DriverManager.registerDriver(new org.postgresql.Driver()); before you create your connection. Perhaps you forgot to register the driver?
For posterity, this should be working now. The problem was that JDBC's isValid() method was failing due to CockroachDB failing to prepare empty statements, which has since been fixed in CockroachDB.

jdbc connection "alternative to Class.forname for driver loading"

can we use anything else instead of Class.forName() for loading a driver for jdbc connectivity
i.e is first step of jdbc connection?
can we use anything else instead of "Class.forname" for loading a driver for jdbc connectivity i.e is first step of jdbc connection?
You haven't even needed that since JDBC 4.1. Just call DriverManager.getConnection() with an appropriate URL.
Just import java.sql.Driver and invoke DriverManager.getConnecion() to establish a database connection. You don't really need to call Call.forName() these days (java7).

Resources