Here you can find the source of getShapeText(Connection conn, String tableName)
private static Map<Integer, byte[]> getShapeText(Connection conn, String tableName) throws SQLException
//package com.java2s; //License from project: Apache License import java.sql.*; import java.util.HashMap; import java.util.Map; public class Main { private static Map<Integer, byte[]> getShapeText(Connection conn, String tableName) throws SQLException { Map<Integer, byte[]> shpText = new HashMap<>(); int count = 0; Statement stmt = null;/*from w ww .ja v a 2s .c o m*/ String query = "SELECT sde.st_asbinary(shape) as shp FROM " + tableName; try { stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(query); while (rs.next()) { count++; //String shp = rs.getString("shp"); byte[] shp = rs.getBytes("shp"); shpText.put(count, shp); } } catch (SQLException ex) { System.out.println(ex.getMessage()); } finally { if (stmt != null) { stmt.close(); } } return shpText; } }