Problems with protobuf-java library


#1

I’m trying to do a program (in Netbeans) that read/decoder Grib Files (for this i use the netcdf.jar library). I get some data and then i try to create an array in SciDB (for this i use scidb4.jar).

The problem is that netcdf.jar use the protobuf.jar v.2.5.0 and, i think that scidb4.jar use protobuf.jar v.2.4.1, because i execute this code:

public static void main(String[] args) {
// TODO code application logic here

    NetcdfFile dataFile = null;
    try {
        Class.forName("org.scidb.jdbc.Driver");
        Connection conn = DriverManager.getConnection("jdbc:scidb://localhost/");

        dataFile = NetcdfFile.open("/home/usuario/GribFiles/a.grb");

        Variable a = dataFile.findVariable("x");
        String name= a.getName();
        String query= "create array " +name+ " <val:double>[i=0:1,1,0]";

        Statement st = conn.createStatement();
        st.execute(query);
    }  catch (ClassNotFoundException ex) {
        Logger.getLogger(PruebaGribSciDB.class.getName()).log(Level.SEVERE, null, ex);
    } catch (SQLException ex) {
        Logger.getLogger(PruebaGribSciDB.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
        Logger.getLogger(PruebaGribSciDB.class.getName()).log(Level.SEVERE, null, ex);
    }

}

and the output is

java.sql.SQLException: java.lang.UnsupportedOperationException: This is supposed to be overridden by subclasses.
at org.scidb.jdbc.Statement.executeInternal(Statement.java:78)
at org.scidb.jdbc.Statement.executeQuery(Statement.java:86)
at org.scidb.jdbc.Statement.execute(Statement.java:188)

:confused: :confused: :confused:
:confused:


#2

In SciDB 15.7, protobuf-java 2.5 classes will be included in the scidb4j itself. So you’ll not only be able to use 2.5, but also be free from the need to include the protobuf jar file.


#3

Did you debug it ???
where you program stop???

try { Class.forName("org.scidb.jdbc.Driver"); }catch(ClassNotFoundException e3) { e3.printStackTrace(); } try { conn = DriverManager.getConnection("jdbc:scidb://localhost/"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); }

and the protobuf-java.jar , scidb4j.jar is in the same file