summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormianrui2012-06-01 06:19:29 (EDT)
committer mwu2012-06-01 06:19:29 (EDT)
commit45b868cff2a9a3f3fe8a864d67aef94608b180c5 (patch)
tree3ef60b82d7da12a74303d467279f3910bfa6d7c3
parent3eefd5fc0fd7ee77c600c78a14704268d3d9f862 (diff)
downloadorg.eclipse.birt-45b868cff2a9a3f3fe8a864d67aef94608b180c5.zip
org.eclipse.birt-45b868cff2a9a3f3fe8a864d67aef94608b180c5.tar.gz
org.eclipse.birt-45b868cff2a9a3f3fe8a864d67aef94608b180c5.tar.bz2
TED – Issue 36056 BRD: MYSQL driver initial metadata collection fails
with query parameter
-rw-r--r--data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/jdbc/ParameterMetaData.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/jdbc/ParameterMetaData.java b/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/jdbc/ParameterMetaData.java
index db75744..725d7fc 100644
--- a/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/jdbc/ParameterMetaData.java
+++ b/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/jdbc/ParameterMetaData.java
@@ -156,6 +156,8 @@ public class ParameterMetaData implements IParameterMetaData
}
catch ( SQLException e )
{
+ if ( "S1C00".equals( e.getSQLState( ) ) )
+ return -1;
throw new JDBCException( ResourceConstants.PARAMETER_TYPE_CANNOT_GET,
e );
}
@@ -188,6 +190,8 @@ public class ParameterMetaData implements IParameterMetaData
}
catch ( SQLException e )
{
+ if ( "S1C00".equals( e.getSQLState( ) ) )
+ return "VARCHAR";
throw new JDBCException( ResourceConstants.PARAMETER_TYPE_NAME_CANNOT_GET,
e );
}
@@ -218,6 +222,8 @@ public class ParameterMetaData implements IParameterMetaData
}
catch ( SQLException e )
{
+ if ( "S1C00".equals( e.getSQLState( ) ) )
+ return 0;
throw new JDBCException( ResourceConstants.PARAMETER_PRECISION_CANNOT_GET,
e );
}
@@ -248,6 +254,8 @@ public class ParameterMetaData implements IParameterMetaData
}
catch ( SQLException e )
{
+ if ( "S1C00".equals( e.getSQLState( ) ) )
+ return 0;
throw new JDBCException( ResourceConstants.PARAMETER_SCALE_CANNOT_GET,
e );
}
@@ -271,9 +279,9 @@ public class ParameterMetaData implements IParameterMetaData
"isNullable",
"ParameterMetaData.isNullable( )" );
assertNotNull( paraMetadata );
+ int result = IParameterMetaData.parameterNullableUnknown;
try
{
- int result = IParameterMetaData.parameterNullableUnknown;
if ( paraMetadata.isNullable( param ) == java.sql.ParameterMetaData.parameterNullable )
result = IParameterMetaData.parameterNullable;
else if ( paraMetadata.isNullable( param ) == java.sql.ParameterMetaData.parameterNoNulls )
@@ -282,6 +290,8 @@ public class ParameterMetaData implements IParameterMetaData
}
catch ( SQLException e )
{
+ if ( "S1C00".equals( e.getSQLState( ) ) )
+ return result;
throw new JDBCException( ResourceConstants.PARAMETER_NULLABILITY_CANNOT_DETERMINE,
e );
}