code: public static int getSRID(Connection connection, TableLocation table) throws SQLException {
          ResultSet geomResultSet = getGeometryColumnsView(connection, table.getCatalog(), table.getSchema(),
                  table.getTable());
          int srid = 0;
          while (geomResultSet.next()) {
              srid = geomResultSet.getInt("srid");
              break;
          }
          geomResultSet.close();
          return srid;
      }
docs: Return the SRID of the first geometry column of the input table
  
  @param connection Active connection
  @param table Table name
  
  @return The SRID of the first geometry column
  
  @throws SQLException