Java Code Examples for java.sql.ResultSet.getURL()

The following are Jave code examples for showing how to use getURL() of the java.sql.ResultSet class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: aceql-http   File: ResultSetWriter.java   View Source Code Vote up 6 votes
/**
    * Format - if detected - an URL
    * 
    * @param resultSet
    * @param columnIndex
    * @param columnValueStr
    * @return
    */
   public String urlFormater(ResultSet resultSet, int columnIndex,
    String columnValueStr) {

try {
    URL url = resultSet.getURL(columnIndex);
    if (url != null) {
	// Its an URL!
	// UrlTransporter urlTransporter = new UrlTransporter();
	// columnValueStr = urlTransporter.toBase64(url);
	columnValueStr = url.toString();
    }

} catch (Exception e) {
    // Do nothing. It's not an URL
}

return columnValueStr;
   }
 
Example 2
Project: calcite-avatica   File: AvaticaResultSetConversionsTest.java   View Source Code Vote up 5 votes
public void getURL(ResultSet resultSet) throws SQLException {
  try {
    resultSet.getURL(ordinal);
    fail("Was expecting to throw SQLDataException");
  } catch (Exception e) {
    assertThat(e, isA((Class) SQLDataException.class)); // success
  }
}