JDBC Driver & JDBC Connection string for Exadata - oracle

I have developed a code which connects to Oracle DB using the JDBC connection string oracle.jdbc.OracleDriver & respective jar for the same.
However my customer moved to a different DB called 'Exadata' recently.
My question is since they are from same vendor 'Oracle' is there any change in the JDBC driver & JDBC connection string to Exadata DB.
Google didn't help much & instead confused me.
Any leads would be appreciated with a URL to the source as well if possible. :)
Thanks!

Exadata is a "regular" Oracle database running on specialized hardware.
There is nothing you need to change in your application.

If they redefine the database service name in tnsnames.ora, they could reuse the code without changing the URL/connect-string.

Related

Oracle APEX 5.1 connect to remote db using JDBC and query data

I have only used db links to get access to remote db so far. Now I have to find a way to use JDBC to connect to remote db and get data. Can someone guide me what all things would I need to ask the remote db admin in order to setup a jdbc connection, and once I have the connection, how do I query the database using java stored procedure, just like I am querying it over remote db right now with db link?
You've described a fairly complicated problem, but haven't given any information about your database or operating system. Are you connecting to a SQL Server database? MySQL? Are you running on Linux? Windows?
First, you'll need a driver. That's going to depend on the database, operating system and versions thereof that you're using. For example, here is the Microsoft ODBC Driver for SQL Server (Oops, looks like it's currently unavailable.)
Second, you need to set up Oracle Heterogenous Services. That's fairly complicated and not something I can answer here. You might start with the Database Gateway for ODBC User's Guide.
Oracle does have gateways for various other databases, but they're licensed additionally from the database itself.

How to replicate existing OracleRDB ODBC connection in Oracle's SQL Developer application?

I am new to Oracle database in general, but I'm attempting to get Oracle's SQL Developer running on a workstation that has pre-configured System DSNs created for an OracleRDB database. I've confirmed the ODBC connections are working because I can use MS Access to connect and link to the tables. The "test" options within ODBC also succeed. Now I am trying to get a similar connection created using SQL Developer so I can see the column types and write queries in a more useful editor.
Here's what I have available when examining the ODBC connection properties:
Now I'm trying to create a duplicate connection in SQL Developer, but I'm at a loss for why things don't work. I first tried using the default SQL Developer installation, but couldn't get things working. Then I discovered there's an OracleRDB extension available, so I installed that, but I keep getting this error when attempting to use similar values:
As I stated, these ODBC connections were pre-configured on the workstation I'm using, so I don't know anything more than what is provided by the Oracle ODBC driver window.
Is there something obvious I'm not seeing or doing to replicate this connection in SQL Developer? Or perhaps something else I can do to debug this to learn more?
UPDATE
On the advice of one answer I'm trying to make the connection with JDBC, but having a hard time understanding what I'm doing wrong. Here's another screenshot with the connection parameters I have available, but with the server and database names changed:
With these values (the port came from my tnsnames.ora file), if I try to make a JDBC connection I keep getting the following error from SQL Developer:
One final attempt I did was to use the proper values in the Oracle RDB tab, and when I use them and click 'test' the Testing Connection dialog just spins and never seems to return:
So I apologize for the long post here, but I'm struggling because there's just something I am really not understanding about how this all works. I appreciate everyone who took the time to read this question.
Oracle SQL Developer is a Java Application. You'll need to get the JDBC Driver for RDB.
Once you have that, in the SQL Developer preferences, find the Third Party JDBC section, and then use that to add an entry and point to the JAR for what you just installed.
Step by step instructions here.
Working connection string for RDB Thin Driver:
RDB_DB_CONN_STR = "jdbc:rdbThin://node.myplace.com:1707/";
where node.myplace.com is the name of the OpenVMS node hosting the RDB Thin Driver, 1707 is the port number assigned to the RDB Thin Driver.

Database url in jmeter?

I have a database stored at a server. I want to load test the server using jmeter.It requires a field called database url? Now what i am supposed to fill in that?
Also it is asking for jdbc driver class? What will be the values of these two?
JMeter uses JDBC.
What is your db ? Oracle, mysql ...
Each Db provides drivers you need to put in jmeter/lib folder.
For url each driver has a syntax, examples:
http://www.petefreitag.com/articles/jdbc_urls/
Then you need to add login/password
your database url should be -jdbc:mysql://localhost:3306/
database url is the host address of the database u can see that when you connect mysql from gui using SQl yog
is the database name that you have created in mysql
Your driver class should be -com.mysql.jdbc.driver
user name and password of the database

Setting connection info using XQJ with Oracle 11g

I am trying to submit XQuery queries to an Oracle 11g database through their XQJ API.
When I instantiate an oracle.xquery.xqj.OXQDataSource as explained in http://www.oracle.com/technetwork/articles/oem/xquery-jdbc-325944.html, I can submit queries fine except that I haven't found how I can set up the server connection (server name, port, username, password, ...) info:
This datasource claims that it doesn't support setting any property.
It doesn't implement the data source constructor which takes a JDBC connection.
I don't see any non standard method to set such info.
When I try to access some random collection like collection("oradb:/foo") I just get an empty result set even when no server is running, suggesting that the driver doesn't even try to connect.
What have I missed and how can I set the server connection info?
Thanks,
Eric
Thanks to Charles Foster I can answer to my own question: the XQJ implementation from Oracle is an old standalone version from January 2010 that is pretty useless and doesn't interact with Oracle databases.
Despite all the Oracle statements about XQJ, I haven't been able to find any client/server XQJ implementation (except one from DataDirect of course) and the way to submit XQuery queries to Oracle databases appears to be through JDBC, embedded in PL-SQL statements.
It is possible in 12.
XQJ to run queries in Java:
http://docs.oracle.com/database/121/ADXDK/adx_j_xqj.htm#ADXDK99930
XQJ to run queries against the database:
http://docs.oracle.com/database/121/ADXDK/adx_j_xqjxdb.htm#ADXDK136

connecting JDBC

Hi guys:)
I am new to servlet.I dont know how to connect oracle database to the servlet application. Can anyone paste Oracle JDBC coding
Register Database Connection parameters:
To include your application specific connection parameters of your database, edit the file data-sources.xml under \config directory. Add the following lines to create a data source. Change the hostname, port, username/password, database name, driver type to suit your application. Make changes for url after # symbol. Save the file. This will register the data-source which can be used across your application.
<data-source
class="oracle.jdbc.pool.OracleConnectionPoolDataSource"
name="ifso817DS"
location="jdbc/Loneifso817DS"
xa-location="jdbc/xa/ifso817XADS"
ejb-location="jdbc/Pooledifso817DS"
url="jdbc:oracle:thin:#insn104a.idc.oracle.com:1521:ifso817"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="travel"
password="travel"
inactivity-timeout="30"
/>
That is taken from: http://www.oracle.com/technology/sample_code/tech/java/servlets/samples/TravelServlet/Readme.html
There are a lot of articles discussing this, but I'll give you the basic steps:
download Oracle JDBC driver from Oracle's homepage, it's called ojdbc6.jar if you're using Java 6
make sure your application can find it on its classpath
since you are using servlets, you're also using a Java application server; read relevant documentation about setting up a JNDI binding to your database (usually this binding will be called jdbc/connectionName)
inside of your application, use this code:
Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("jdbc/connectionName");
Connection conn = ds.getConnection();
This should be enough to get you started.
For more information, Google is your friend. Check out Wikipedia's JDBC page. Google "Oracle JDBC connection" for more info.
One thing that might give you headaches if you've never done stuff like this: when defining Oracle's URL for your app. server, it's format is as follows:
jdbc:oracle:thin:[user/password]#[host][:port]:SID
So you have to substitute appropriate values when defining the connection for a JNDI binding.
check this http://www.java2s.com/Code/Java/Servlets/JDBCandServlet.htm. You need to modify driver class name and connection url to connect to Oracle DB. Check http://www.java2s.com/Code/Java/Database-SQL-JDBC/OracleJDBCDriverload.htm for Oracle DB connection details

Resources