Skip to content
Snippets Groups Projects
Commit 5ded00bd authored by jburke.cadc's avatar jburke.cadc
Browse files

If the table value representing the Column size is null, set Column size to null, not 0.

Use the correct Formatter interface in ResultSetIterator.
Handle java.sql.Array return types in IntArrayFormatter.

git-svn-id: https://opencadc.googlecode.com/svn/trunk@199 728ff76a-78ac-11de-a72b-d90af8dea425
parent 99981d51
No related branches found
No related tags found
No related merge requests found
...@@ -69,12 +69,26 @@ ...@@ -69,12 +69,26 @@
package ca.nrc.cadc.tap.writer.formatter; package ca.nrc.cadc.tap.writer.formatter;
import java.sql.SQLException;
public class IntArrayFormatter implements Formatter public class IntArrayFormatter implements Formatter
{ {
public String format(Object object) public String format(Object object)
{ {
if (object == null) if (object == null)
return ""; return "";
if (object instanceof java.sql.Array)
{
try
{
java.sql.Array array = (java.sql.Array) object;
object = (int[]) array.getArray();
}
catch (SQLException e)
{
throw new IllegalArgumentException("Error accessing array data for " + object.getClass().getCanonicalName(), e);
}
}
if (!(object instanceof int[])) if (!(object instanceof int[]))
throw new IllegalArgumentException("Expecting int[], " + object.getClass().getCanonicalName() + " not supported."); throw new IllegalArgumentException("Expecting int[], " + object.getClass().getCanonicalName() + " not supported.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment