ORA-00604. I create connection pool and I trying to ping in glassfish - oracle

I create Connection pool with this parameters:
I try to ping in glassfish web-interface and I have got this exceprion:
Ping Connection Pool failed for MyPool.
Connection could not be allocated because: ORA-00604: error occurred
at recursive SQL level 1 ORA-12705: Cannot access NLS data files or
invalid environment specified Please check the server.log for more
details. An error has occurred Ping Connection Pool failed for MyPool.
Connection could not be allocated because: ORA-00604: error occurred
at recursive SQL level 1 ORA-12705: Cannot access NLS data files or
invalid environment specified Please check the server.log for more
details.
I add ojdbc6.jar(download from official oracle web site) in C:\glassfish5\glassfish\domains\domain1\lib\ext (I have Oracle Database Express Edition 11g Release 2)

1) Please try by changing : Resource Type to javax.sql.ConnectionPoolDataSource and Database driver vender to oracle.jdbc.pool.OracleConnectionPoolDataSource
2) Try again a Ping

Related

Trying to connect to database, getting error ORA-12154: TNS:could not resolve the connect identifier specified

I am new to oracle, I just installed oracle when I am trying to connect to the database I got this error.ORA-12154: TNS: could not resolve the connect identifier specified.
To connect onn Oracle DB you should configure the file tnsnames.ora wich define DNS to your oracle server.
After configure file, you can test your connection with tnsping DNS_NAMED_SERVER
if you never heard about tns names, you can read more on Oracle Docs https://docs.oracle.com/database/121/NETRF/tnsnames.htm#NETRF260

Connect to Teamcity to OCI Autonomous Transaction Processing Database

I am trying to migrate my Teamcity database from internal to external, and I registered a free tier ATP database. I am not sure how to how to set the connection URL in the teamcity database property files to access the database.
The tnsnames I am referencing is from the following:
teamcitytestdb_medium = (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=adb.us-phoenix-1.oraclecloud.com))(connect_data=(service_name=rhhea6hkgj2saju_teamcitytestdb_medium.atp.oraclecloud.com))(security=(ssl_server_cert_dn="CN=adwc.uscom-east-1.oraclecloud.com,OU=Oracle BMCS US,O=Oracle Corporation,L=Redwood City,ST=California,C=US")))
The command I ran for the tests below are using this command:
bin/maintainDB.sh migrate -T $(pwd)/database.oracle.autodb.properties.dist
Here is a list of commands and output I tried:
Test1:
connectionUrl=jdbc:oracle:thin:#//adb.us-phoenix-1.oraclecloud.com:1522/rhhea6hkgj2saju_teamcitytestdb_high.atp.oraclecloud.com
driverName=oracle.jdbc.driver.OracleDriver
connectionProperties.user=<username>
connectionProperties.password=<password>
--------- output ---------
Cannot proceed with 'migrate' command: Could not connect to the target database: Could not connect to Oracle server.
IO Error: Got minus one from a read call: java.sql.SQLRecoverableException: IO Error: Got minus one from a read call. Caused by: oracle.net.ns.NetException: Got minus one from a read call
Test2:
connectionUrl=jdbc:oracle:thin:#tcps://adb.us-phoenix-1.oraclecloud.com:1522/rhhea6hkgj2saju_teamcitytestdb_high.atp.oraclecloud.com?wallet_location=/Users/jiuwang/Documents/Spectra/3rd-jars/teamcity-tests/Wallet_TeamCityTestDB
driverName=oracle.jdbc.driver.OracleDriver
connectionProperties.user=<username>
connectionProperties.password=<password>
--------- output ---------
Cannot proceed with 'migrate' command: Could not connect to the target database: Could not connect to Oracle server.
IO Error: The Network Adapter could not establish the connection: java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection. Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection
Test3:
connectionUrl=jdbc:oracle:thin:#adb.us-phoenix-1.oraclecloud.com:1522:rhhea6hkgj2saju_teamcitytestdb_medium.atp.oraclecloud.com
driverName=oracle.jdbc.driver.OracleDriver
connectionProperties.user=<username>
connectionProperties.password=<password>
--------- output ---------
Cannot proceed with 'migrate' command: Could not connect to the target database: Could not connect to Oracle server.
IO Error: Got minus one from a read call: java.sql.SQLRecoverableException: IO Error: Got minus one from a read call. Caused by: oracle.net.ns.NetException: Got minus one from a read call
How should I setup this correctly so the migration tool can connect to the database? Thanks
You need to provide the TNS_ADMIN to point to the path where you have downloaded the wallet credentials to connect to Autonomous Database.
Also, the JDBC version is important. You can use pass TNS_ADMIN as part of the connection URL only if you are using JDBC driver version 18.3 and above.
I would suggest to try a DataSourceSample.java to make sure if the connection works.
DB_URL ="jdbc:oracle:thin:#wallet_dbname?TNS_ADMIN=/Users/test/wallet_dbname";
Also, refer to this page for more details.

Oracle sql developer connection - Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection

I download oracle sql developer "Windows 64-bit with JDK 8 included" from oracle website /download section. I unzipped it and tried to make a connection. I tried couple of options but I am getting "Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection" error.
Can any one help me with this. Thank you
Do you have a database?
I downloaded SQL Developer, now what?
SQL Developer is just a client, you need a database to connect to.

How to catch Sqlcmd errors without showing the error message

I am trying to find out with SQLEXPRESS is installed on a server by running the following
sqlcmd -S LT1183 -U uname -P pass123 -Q "SELECT ##servername"
If it is installed it gives out the server name but if its not, it throws the below error.
Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : TCP Provider: Error code 0x2AF9.
Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
I am looking for a way to suppress this error and instead show a custom error message. Is that possible?
Thanks in advance.
This may not be possible with sqlcmd, since the error stems from connecting the the server, which upon error immediately terminates the sqlcmd.
if you can use powershell, you may find some luck using invoke-sqlcmd.
Powershell Try Catch invoke-sqlcmd

Getting Error when connection scott schema from SQL Developer

I am getting below error when ever trying to connect DB from sql developer.
Status : Failure -Test failed: Listener refused the connection with
the following error: ORA-12514, TNS:listener does not currently know
of service requested in connect descriptor
But successfully connect from command prompt.
I have set the path in environment variable correctly.
Can you please help me with this issue.
Thanks

Resources