Connecting to an Apache Derby/JavaDB database using Oracle SQL Developer [duplicate] - jdbc

This question already has answers here:
How to use SQLDeveloper to connect to embedded Derby database
(4 answers)
Closed 5 years ago.
I've been trying to connect to an Apache Derby/JavaDB embedded database using Oracle SQL Developer but without much success.
I've tried to create a new connection using the following JDBC URL:
jdbc:derby:/path/to/file/database.derby;create=true
which resulted in an error:
Status : Failure -Test failed: Invalid connection info specified. Verify the URL format for the specified driver.
Previously I've added derby.jar through Tools > Preferences > Database > Third Party JDBC Drivers.
Given that JavaDB is now a supported Oracle product I'm not understanding why is not better integrated with its development tools.
Any guidance will be much appreciated. Thanks in advance.

Your derby url seems wrong. You need to point the url to the directory of the database, not the database itself.
jdbc:derby:/path/to/file/;create=true
Have a look at the examples.
jdbc:derby:/reference/phrases/french
Open a connection to the database /reference/phrases/french.
On a UNIX system, this would be the path of the directory. On a
Windows system, the path would be C:\reference\phrases\french if the
current drive were C. If a jar file storing databases were in the
user's classpath, this could also be a path within the jar file.
From the docs:
The connection URL syntax is as follows:
jdbc:derby:[subsubprotocol:][databaseName][;attribute=value]
Subsubprotocol, which is not typically specified, determines how Derby
looks for a database: in a directory, in memory, in a class path, or
in a jar file. Subsubprotocol is one of the following:
directory: The default. Specify this explicitly only to distinguish a database that might be ambiguous with one on the class
path.

try connecting to the Derby DB using the Eclipse Java EE IDE for Web Developers instead of Oracle SQL Developer. In the latest versions it is has the full integrations.

Related

Tableau desktop 2021.02 oracle server 19c frequent disconnection - error code dacbe23f

I recently started using tableau. I followed below step to connect with oracle.
I placed ojdbc8-19.3.0.0.jar into C:\Program Files\Tableau\Drivers directory, java 8 installed and JAVA_HOME is set.
Below is the jdbc jar i am using
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>19.10.0.0</version>
</dependency>
Then I am able to connect to oracle database, but during data filtering I am getting disconnection very frequently, almost unusable and this error code "dacbe23f"
Also in log below error
"user":"-","k":"msg","v":"Cannot load library from preferred location, "C:\Program Files\Tableau\Tableau 2021.2\bin\oci.dll", since it doesn't exist.","ctx":{"client-procid":..............."
Load library failed: Cannot load library oci: The specified module
could not be found
After checking on tableau support, I found this post. Please read this question it is same with my situation, however this post is post suggesting the use of oracle client, I am not using oracle client
I found oracle client in here
I am thinking of setting oracle home in env variable and copy the dll files to oracle_home directory as mentioned in env variable.
Can anyone please suggest do I really need to install oracle client or specifying the ORACLE_HOME should be enough.
Also I am little confused why tableau is looking for oracle client ddl where as it is using jdbc jar for connection and able to connect.
You might want to use Oracle JDBC driver instead of JDBC-OCI driver with Tableau.
The JDBC OCI driver use requires you to set ORACLE_HOME and LD_LIBRARY_PATH.

Data Pump export using cloud shell

I am trying to export schema using data pump on Oracle Cloud Autonomous database.
I am using cloud shell to export schema.
When I tried to do the final step:
expdp admin/password#DB_HIGH schemas=SCHEMA_NAME directory=data_pump_dir dumpfile=exp%U.dmp filesize=1G logfile=expot.log
I got
UDE-12154: operation generated ORACLE error 12154 ORA-12154:
TNS:could not resolve the connect identifier specified
Do I need Oracle instant client to do export?
The Oracle client code uses one of three ways to look up connect data:
A flat file named tnsnames.ora
Oracle Names service
LDAP
When the complete ORA-12154 error appears with the text line, your program has found a working Oracle client install. However, the specified Oracle service is not listed in tnsnames.ora, Oracle Names or LDAP.
The first step in the troubleshooting process is to determine which name resolution method is deployed at your site. Most sites use tnsnames.ora, but enough use Oracle Names and LDAP, so it’s best to confirm this information.
If you are not the database administrator, get in touch with the people managing your Oracle systems and find out which method you should be using. They may be able to guide you in fixing the problem in accordance with your site’s standards.
The client code decides which mechanism to use based on the file sqlnet.ora. This file and tnsnames can usually both be found in the Oracle install directory (“ORACLE_HOME”), under network/admin/. This location may be overridden with the environment variable TNS_ADMIN.
If the sqlnet.ora file does not exist or does not specify a resolution method, then Oracle Net uses tnsnames.ora.
Example locations of Oracle networking files include:
Windows
ORANTNET80ADMIN
ORACLEORA81NETWORKADMIN
ORAWIN95NETWORKADMIN
ORAWINNETWORKADMIN
UNIX / Linux
$ORACLE_HOME/network/admin/
/etc/
/var/opt/oracle/
If you fix the naming issues, but you still see the ORA-12154 error, check the Oracle service to confirm that it’s available for connections. A power outage, server failure, or network connectivity issue will make this resource inaccessible. It’s also possible that scheduled maintenance or repairs of an unrelated Oracle issue may take that resource temporarily offline.
Thanks

Unable to connect db2 database in JMeter

Getting below response on connecting to DB2 database:
"Cannot create PoolableConnectionFactory ([jcc][t4][10109][10354][3.59.81] The version of the IBM Universal JDBC driver in use is not licensed for connectivity to QDB2 databases. To connect to this server, please obtain a licensed copy of the IBM DB2 Universal Driver for JDBC and SQLJ.
An appropriate license file db2jcc_license_.jar for this target platform must be installed to the application class path. Connectivity to QDB2 databases is enabled by any of the following license files: [ db2jcc_license_cisuz.jar ]. ERRORCODE=-4472, SQLSTATE=42968)"*
db2jcc.jar and db2jcc_license_cisuz.jar already added in JMeter(3.2)'s lib folder.
My configuration:
Screenshot of the jmeter/lib folder:
Although the message seems to indicate a license issue , I see an error in your configuration on Validation Query.
Can you try to fix it and see if you still get the error ?
Change it to:
select 1 from sysibm.sysdummy1
Also can you show a screenshot of the jmeter/lib folder and highlight the presence of the 2 jars for DB2 ?
The error you're getting is about mismatch of the DB2 JDBC Driver you are trying to use with JMeter and DB2 version on the server.
See IBM data server client and driver types IBM KB article for more information on JDBC driver types.
Personally I would recommend obtaining JDBC driver directly from your DB2 installation, it normally lives under java or jdbc folder in the DB2 server installation root.
So I would recommend copying the following files somewhere to JMeter Classpath (normally "lib" folder of your JMeter installation)
db2jcc4.jar
db2jcc_license_cu.jar
(depending on your DB2 version and type you might need other files as well)
JMeter restart will be required to pick the .jars up.
See The Real Secret to Building a Database Test Plan With JMeter article to learn more about databases load testing concept using JMeter.

Using BigQuery in DataGrip with JDBC

Has anyone been able to use the new JDBC drivers for BigQuery in JetBrains DataGrip?
I've followed the these steps
Created a driver in DataGrip with all the jar files
Created a database with a connection string with a service account file
The connection test says successful, but once I try to query something I receive an error:
java.lang.ClassNotFoundException: com.google.api.client.json.JsonFactory
I've added the following files from the Simba ZIP into the DataGrip driver:
GoogleBigQueryJDBC42.jar
jackson-core-2.1.3.jar
google-api-client-1.22.0.jar
google-api-services-bigquery-v2-rev320-1.22.0.jar
google-http-client-1.22.0.jar
google-http-client-jackson2-1.22.0.jar
google-oauth-client-1.22.0.jar
So I'm not sure what to do next. I tried changing their order in DataGrip but it didn't seem to make a different.
My connection string also looks OK I think:
jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=...;OAuthType=0;OAuthPvtKeyPath=...;OAuthServiceAcctEmail=...;
You may get this error when the driver JAR files are not referenced correctly in the tool. I have listed out the steps I used to connect to BigQuery via DataGrip.
Add a new driver by adding all the JAR files from the zip. The correct class name should be selected from the "Class" drop down in this step.
Add a new data source by selecting the newly created BigQuery JDBC driver. Provide the correct connection URL in this step.
If the test connection succeeds, create a new query for the same datasource.
Make sure your query uses the correct format "dataset.tablename" and is running on the data source you just tested.
For me replacing P12 with Json worked. But, cannot use DataGrip or in general JDBC to access BigQuery because of various query/incompatibility issues.
This video can be referred : https://www.youtube.com/watch?v=r9l2c_aQPoQ&ab_channel=JetBrainsTV
to use the new simba jdbc drivers for BigQuery in JetBrains DataGrip. It covers all steps one by one for working setup.
Here is the blog which refers this video: https://blog.jetbrains.com/datagrip/2018/07/10/using-bigquery-from-intellij-based-ide/
Drivers can be downloaded at : https://cloud.google.com/bigquery/providers/simba-drivers
Note: Make sure to go through comments on blog to authenticate without creating service account on gcp.
Hope this is helpful!

Setting Up Oracle JDBC Datasources

I'm trying to set up a ColdFusion 8 data source using JDBC on a CLSE5 Linux server. I've downloaded the JDBC drivers from Oracle for both 10g and 11g and placed the JAR files in %CF_INSTALL_Folder%/runtime/lib. I verified that this folder is in the class path on the CF admin settings summary page. According to this Oracle JDBC wiki, the JDBC URL should be:
jdbc:oracle:thin:#[HOST][:PORT]:SID
If I want to use different drivers for different connections, How do I differentiate between them on the data source connection form?
You specify which JDBC driver to use by specifying the JAR's class name in the Driver Class field on the data source administration page. However, this requires that your two JAR files have unique class names.
I would assume that you could use the 11g drivers to connect to your 10g database without any problems unless you are needing to use something specifically deprecated with the 11g drivers. I would at least try that first and see if any issues crop up.
Here is a link to some documentation that describes the different fields on the data source administration page: Connecting to other data sources
Driver Class
The fully qualified class name of the driver. For example, com.inet.tds.TdsDriver. The JAR file that contains this class must be in a directory defined in the ColdFusion classpath.

Resources