salvatore-piccione / orientdb-jdbc

OrientDb JDBC Driver

Home Page:http://code.google.com/p/orient/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OrientDB JDBC Driver

OrientDB (http://code.google.com/p/orient/) 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

How to build

Orient-jdbc uses maven, so do a

mvn install

then you can include in your own projects

	<dependency>
		<groupId>com.orientechnologies</groupId>
		<artifactId>orientdb-jdbc</artifactId>
		<version>1.0-SNAPSHOT</version>
	</dependency>

How to build a jar-with-dependencies

Do a

mvn assembly:assembly

to obtain a jar with dependency included.

It is very usefull to include under applications such as DBvisualizer.

How can be used in my code?

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.getString("stringKey");
rs.getInt("intKey");

rs.close();
stmt.close();

About

OrientDb JDBC Driver

http://code.google.com/p/orient/


Languages

Language:Java 100.0%