Error on load Data via JDBC


#1

Hello,

I use SciDb v13.12 und I want to load data into SciDB like
[ul]http://www.scidb.org/HTMLmanual/13.12/scidb_ug/ch05s02s02.html[/ul]
[ul]http://www.scidb.org/HTMLmanual/13.12/scidb_ug/ch05s02s03.html[/ul]
[ul]http://www.scidb.org/HTMLmanual/13.12/scidb_ug/ch05s02s04.html[/ul]
I use Java (JDK1.7.0_17) and the JDBC client (v13.12, http://downloads.paradigm4.com/client/13.12/jdbc/scidb4j.jar + protobuf-java-2.4.1.jar).

Here is my data file (/home/userxy/test.scidb):

{0}[
(0,10,0,4),
(0,11,1,5),
(1,10,2,6),
(1,11,3,7)
]

and here is my java code:

01 import java.sql.Connection;
02 import java.sql.DriverManager;
03 import java.sql.ResultSet;
04 import java.sql.Statement;
05
06 public class Test {
07	public static void main(String[] args) {
08		try {
09			Class.forName("org.scidb.jdbc.Driver");
10			Connection connection = DriverManager.getConnection("jdbc:scidb://172.20.99.238/", "userxy", "passxy");
11			Statement stmt = connection.createStatement();
12			
13			//stmt.execute("DROP ARRAY testFlat");
14			//connection.commit();
15			stmt.execute("CREATE ARRAY testFlat <x:int32, y:int64, a:int64, b:int64> [i=0:4,100,0]");
16			connection.commit();
17			stmt.execute("LOAD testFlat FROM '/home/userxy/test.scidb'");
18			connection.commit();
19			ResultSet rs = stmt.executeQuery("SELECT * FROM analyze(testFlat)");
20			rs.close();
21			stmt.close();
22			connection.close();
23		} catch (Exception e) {
24			e.printStackTrace();
25		}
26	}
27 }

(1) If I run the code without commit, the program hang on line 17 (the second AQL-statement).

(2) If I run the code with commits, I have a exception on line 19:

java.sql.SQLException: java.sql.SQLException: org.scidb.client.Error: Unknown network message type: 28763
	at org.scidb.jdbc.Statement.executeInternal(Unknown Source)
	at org.scidb.jdbc.Statement.executeQuery(Unknown Source)
Caused by: java.sql.SQLException: org.scidb.client.Error: Unknown network message type: 28763
	at org.scidb.jdbc.ResultSet.<init>(Unknown Source)
	... 3 more
Caused by: org.scidb.client.Error: Unknown network message type: 28763
	at org.scidb.io.network.Message.parseFromStream(Unknown Source)
	at org.scidb.io.network.Network.read(Unknown Source)
	at org.scidb.client.Array.fetch(Unknown Source)
	... 4 more

(3) If the array testFlat already exists and i run the program inclusive line 13 and 14, I have a exeption on line 17:

java.sql.SQLException: java.sql.SQLException: org.scidb.client.Error: Unknown network message type: 13366
	at org.scidb.jdbc.Statement.executeInternal(Unknown Source)
	at org.scidb.jdbc.Statement.executeQuery(Unknown Source)
	at org.scidb.jdbc.Statement.execute(Unknown Source)
Caused by: java.sql.SQLException: org.scidb.client.Error: Unknown network message type: 13366
	at org.scidb.jdbc.ResultSet.<init>(Unknown Source)
	... 4 more
Caused by: org.scidb.client.Error: Unknown network message type: 13366
	at org.scidb.io.network.Message.parseFromStream(Unknown Source)
	at org.scidb.io.network.Network.read(Unknown Source)
	at org.scidb.client.Array.fetch(Unknown Source)

(4) If I execute the AQL-statments in iquery, I have no problems.

I believe the probleme is not deterministic, because with the virtual maschine my complete program run sometimes without any exeptions.

Is there a problem with the socket connection, the JDBC-Client or the wrapper on the SciDB-Server?

For my test I used SciDB v 13.12 on Ubuntu and the SciDB v13.12 virtual maschine.

Can anybody help me?


#2

It turns out that the SciDB JDBC library presently only supports Java 6. Can you check to see if your code works on Java 6? It may be that you’re using Java 7.