0

I want to use PostgreSQL JDBC to retrieve array elements of which type is geometry. But when I tried to use methods:

Route route=null;
String sql="Select * from route where route_id=?";
PreparedStatement pstmt=null;
try {
    pstmt = localConn.prepareStatement(sql);
    pstmt.setInt(1,routeId);
    ResultSet rs = pstmt.executeQuery();
    if(rs.next()){
            Array points = rs.getArray("points");
            PGpoint[] pgPoints=points.getArray();
            ......
        }

}

error occured:

org.postgresql.jdbc4.Jdbc4Array.getArrayImpl(long,int,Map) is not implemented.

So, are there any other methods that I can get elements in geometry array?

Thanks!

2
  • Could you show us the SQL query?
    – npe
    Commented Aug 9, 2012 at 14:19
  • yes,but i use PreparedStatement to build the sql: Route route=null; String sql="Select * from route where route_id=?"; PreparedStatement pstmt=null; try { pstmt = localConn.prepareStatement(sql); pstmt.setInt(1,routeId); ResultSet rs = pstmt.executeQuery(); if(rs.next()){ Array points = rs.getArray("points"); PGpoint[] pgPoints=points.getArray(); ...... } }
    – King
    Commented Aug 9, 2012 at 15:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.