THIS PROJECT IS NOT ACTIVE AND WILL BE DELETED
MASTER BRANCH IS MANTEINED BY orientechnologies
OrientDB JDBC Driver
OrientDB (https://github.com/nuvolabase/orientdb) is a NoSql DBMS that support a subset of SQL ad query languge.
This project is an effort to develop a JDBC driver for OrientDB
Include in your projects
Orient-jdbc are deployed on sonatype’s maven repository. At the moment only snapshots are available, so
com.orientechnologies orientdb-jdbc 1.0-SNAPSHOT
How to build
Orient-jdbc uses maven, so do a
How to build a jar-with-dependencies
to obtain a jar with dependency included under target directory.
Just copy orientdb-jdbc-1.0-SNAPSHOT-all.jar to your classpath.
It is very usefull to include under applications such as DBVisualizer.
How can be used in my code?
The driver is registered to the Java™ DriverManager and can be used to work with all the OrientDB database types: memory, local or remote.
The driver’s class is com.orientechnologies.orient.jdbc.OrientJdbcDriver.
Use your knowledge of JDBC API to work against OrientDB.
First get a connection
Properties info = new Properties(); info.put("user", "admin"); info.put("password", "admin"); Connection conn = (OrientJdbcConnection) DriverManager.getConnection("jdbc:orient:remote:localhost/test", info);
Then execute a Statement and get the ResultSet
Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("SELECT stringKey, intKey, text, length, date FROM Item"); rs.next(); rs.getInt("@version"); rs.getString("@class"); rs.getString("@rid"); rs.getString("stringKey"); rs.getInt("intKey"); rs.close(); stmt.close();
The driver retrieves Orient metadata (e.g.:
rid,class and @version) only on direct queries.
Take a look at tests code to see more detailed examples.