How to export ORACLE XE database to have JAVA support? - java

Hello I am quite new to oracle and databases in general.
I have been creating database using Oracle 11g Express for some time, I used only Pl/SQL so far, but now I need to work with Java classes and I just found out Express version do not support java, (when using loadjava, I get error ORA-29538: Java not installed )
So is there way to install java to database or is there simple way to export database (tables, relations, types, data, etc) to some other version what does support java ?
p.s I know that some/most of functions can be done with pl/sql, but I need to use Java.

The Oracle XE doesn't support Java in database (and it can't be additionally installed. For java support you need the full version - at least Standard Edition. Note that contrary to XE you will need license to use this version productive.
You may export / import using data pump

Related

Oracle Database - Can the installed Java version in the xxx/oracle/product/11.2.x.x/jdk/ be upgraded?

By default when you install the Oracle Database, it installs a JDK/JRE into the directory xxx/oracle/product/11.2.x.x/jdk/.
This appears to be hardcoded into the Oracle Tools such as opatch, dbca etc. i.e. Java is required to support the database management.
With the latest version of Oracle 11.2.0.4.3 the version of Java that is provided is 1.5.0_51.
Has anyone successfully patched this version of Java to a JDK 6/7/8 recent version? NB. The PSU updates from Oracle don't appear to patch this.
NB. This question isn't related to the OJVM which runs inside the Oracle Database.
You can't.
Well, you can, if you're willing to break your database installation and violate your support contract.
See this discussion:
The JVM is an integral part of Oracle and without the proper,
certified version of the JVM the database will not run properly. In
fact if you use Oracle installer and elect to remove the JVM the
database itself will be removed also.
Oracle 11g installs with JDK 1.5 and that is the ONLY version that is
certified to work properly with 11g. If you attempt to use anyother
version you are violating your support contract and will likely have
errors.
NB. This question isn't related to the OJVM which runs inside the Oracle Database.
And how do you know it's not related? The "OJVM which runs inside the Oracle database" has to have a JVM installation known to work with the database somewhere.
A bit late.
The embedded JVM cannot be upgraded with any arbitrary JDK/JRE by customers; it requires some development work in terms of security, memory management, and so on, as part of the RDBMS relase. Iow, only the database develpoment team can do it.
The 12c R1 release of the Oracle database comes with JDK 6 (the default) and JDK 7 (upgrade by running a one liner Perl script).
The RDBMS comes with a JRE for use by Oracle tools exclusively which is orthogonal to the embedded JVM.

Is JAVA DB compliant with Oracle 11 G?

I am using JAVA DB (Part of JDK1.7) for my development environment. We have Oracle 11g on our SIT environment. I was researching whether JAVA DB (Which is based upon Apache Derby) is compliant with Oracle 11g i.e. Will I need some changes in my query structure or code if I try to migrate my code from JAVA DB to Oracle 11g?
Java DB and Oracle 11g are not entirely compatible with each other. Depending on your query's complexity, you may or may not need to port your code.
it just require the connection to particular db which are using do need any extra code for db it is same for any database
SQL Compatibility is a big topic. You might want to start here: http://wiki.apache.org/db-derby/SQLvsDerbyFeatures

Is there a driver for SQLite in Java?

I did some research on their site, and after some Google-ing, it looks like there are only drivers for C & C++. Is there an open driver that I can use with SQLLite, or is there a way I can use it with JDBC?
UPDATE
I'm doing development on Linux, but I would like to keep my options open. Native libraries would work, but wouldn't give the cross-platform freedom that I'm used to with Java.
I have used org:xerial:sqlite-jdbc
Example Groovy script:
#Grab(group='org.xerial', module='sqlite-jdbc', version='[3.6.4,)')
sql = groovy.sql.Sql.newInstance("jdbc:sqlite:test.db","org.sqlite.JDBC")
sql.execute("create table students(name, age)")
(note: 3.6.4 is not the latest version)
SQLite JDBC is completely written in Java, so there are no external dependencies.
SQLite is a native library - therefore a platform independent solution is not that simple. The SQLiteJDBC project uses a internally complex but working system for accessing SQLite database platform independent (on most platform with a good speed). As the name implies it can be used via JDBC (see code sample on the main page).
If you only need one specific platform you can also use the SQLite Java wrapper. For windows there are pre-compiled binaries; sources are also available.
There is also SQLJet, which is a pure java impl which is compatible with sqlite.

Embedding mysql in java desktop application

i am not clear about steps/configuration details about how i can embed mysql in a Java desktop application so that it(application) can be installed on any machine through a single executable file and doing so sets up database and also provides an exe to run the app.Till now i have built my app using netbeans and i have used mysql to set up database.plz guide me further.
MySQL isn't an embedded database - the only JAR related to it is the JDBC driver. It requires a installation process, which might be able to be scripted via Java, but the process will definitely function outside of the Java application you intend it to support. Meaning, you can turn off your Java application but the MySQL service/daemon will still be running.
Only the libmysqld is embeddable.
There are embedded databases - SQLite, Firebird - and embedded databases made in Java - HSQL, Derby/(can't remember what it was called before). I believe SQL Server Compact Edition is embeddable, while SQL Server Express/MSDE is not. I don't know if Oracle has an embeddable version....
I would strongly recommend H2. It is a very fast embedded database written in Java and I've found it easier to use than some of the others mentioned such as HSQL.
Edit:
On the H2 website, you can see a speed comparison of H2 vs Derby, HSQL, MySql, etc...
Here's information on how to backup the database.
While theoritcaly possable it would not be easy. The standard MySql distributions assume you want to set up a general purpose database server with separate from the client applications cominicating via odbc etc.
You may be better looking at the "pure java" options like HSQL or JavaDB which are designed to be embedded in a java application, and need little or no "setup".
Another possibility is Sqlite which only needs a single binary plus the sqljbbc jar file. This is again designed from scratch to be embedded inside an application and requires zero admin apart from allocating a file for the database.
Take a look at http://dev.mysql.com/doc/refman/5.0/en/connector-mxj.html. I do not remember the exact details but I was able to embed MySQL db in desktop application without user needing to install it separately.
The key class is com.mysql.management.MysqldResource.
Here is the example, http://dev.mysql.com/doc/refman/5.0/en/connector-mxj-configuration-java-object.html
The mysql-connector-mxj-gpl-db-files.jar file contains MySQL installation files for all the platforms. If you know which is your target platform, you can strip other platform versions from jar, to reduce download size for end user.
If you want an embedded database with java, then use one written in Java designed to be embedded. I know Apache Derby Can be embedded and apparently H2 too.
How big amount of data dó you need the database to handle?

What is the JDBC equivalent to query an IBM Domino data store?

I need to query an IBM Domino data store that was populated using Lotus Notes from within a Java application. I am hoping that IBM followed the JDBC design pattern so that I can implement similarly to what I have done to get data from Oracle. Where should I start?
I am aware that IBM does not support JDBC for Domino. What I need is an equivalent.
Searching Google for "java lotus notes jdbc" yields this note from IBM:
Question
Is Lotus® Domino® Driver for JDBC (LDDJ) supported on current versions of IBM® Lotus Notes® and Lotus Domino?
Answer
IBM no longer provides a Notes JDBC driver since Java developers may utilize the Notes.jar to make API calls into Notes databases. The Notes JDBC driver is no longer provided nor supported.
This really is no true equivalent to a JDBC driver if by that you mean something that works in a similar way. The sql style interface provided by NotesSQL and the JDBC driver was always severely limited.
To directly interact with the data with java you need to use the Notes java api using Notes.jar (local) or NCSO.jar (remote IIOP). This gives you a notes style access to the data. Your data is organized as databases of documents containing items. The documents are indexed into views and an individual document can be indexed by multiple views. There are also various built in search facilities.
If you just need to provide external access to a relatively fixed query a web service built into the application is a good way to go. Internally this would use the native notes api (java or lotusscript) and you'd probably want to get the developer of the database o do that for you.
If you really need to have free access to the data and want to query it with SQL you will have to export it to an RDBMS through a number of tools and some of these can keep your data in sync. Since there is no generic way to look at Notes data as simple tables you need to configure this export to match the application requirements.
Lotus Notes/Domino isn't really an equivalent data store to something like Oracle, so finding something to slot into your existing solution could be tricky. As matt b suggested, you could try using the Notes Java api supplied by notes (You should be able to get this from a notes client install). Another option is to use the wrapper api Domingo which takes some of the edges off notes.jar (which is itself a wrapper for the C apis).
A simpler option might be to use http and xml (assuming you only want to read data(?)). If you enable http on the domino server, you can get xml data out of views.
http://www.yourserver.com/db.nsf/viewname?readviewentries
Salgiza's answer to this question has more detail on this.
Lotus Notes JDBC Driver might answer some of your questions.
Lotus Notes is not a relational database, I do recall from some time ago, they started supporting java instead of lotus script, there is a good chance that they support an external java API.
According to wikipedia:
External to the Lotus Notes
application, IBM provides toolkits in
C, C++, and Java to connect to the
Domino database and perform a wide
variety of tasks. The C toolkit is the
most mature and the C++ toolkit is an
objectized version of the C toolkit,
lacking many functions the C toolkit
provides. The Java toolkit is the
least mature of the three and can be
used for basic application needs.
So if you can get your hands on a toolkit you should be ready to roll.
I noticed on the toolkit page that they support an odbc driver,
so you should be able to use the jdbc-odbc bridge.
OpenNTF have released a JDBC driver see: JDBC Access for IBM Lotus Domino
Sun & Son www.sunandson.com have just put their Notes JDBC Driver through 12 months of IBM certification - this is a fully supported product - and has been Cognos JDBC certified
DBC Driver for Notes will be supported in Cognos Q3 - 10.2.1 Fix Pack 4
and then in Q4 - it will be in the main point release 10.2.2
Here are a few things to keep in mind about the DomSQL driver:
The client component is pure Java code, so it should run on any platform
The server component, which runs on the Domino server, includes some C code
The upcoming release of the Data Modeler provides seamless integration of the DomSQL driver and a new Metadata Library module, which aggregates all of the Data Modeler metadata definitions across the enterprise.
Although there is an open version of the DomSQL driver available for download from the OpenNFT.org site, the Sun & Son enhanced DomSQL driver has gone through the Cognos certification process and is the only version that will work with Cognos.
There is a NEW JDBC Driver for IBM Notes Domino that is IBM Certified http://www-304.ibm.com/partnerworld/gsd/solutiondetails.do?solution=51151&expand=true&lc=en

Categories

Resources