db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Serre (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DDLUTILS-86) New attribute of Column. Native type is a value of TYPE_NAME in the result set of DataBaseMetadata.getColumns(...).
Date Thu, 05 Jun 2008 08:15:45 GMT

    [ https://issues.apache.org/jira/browse/DDLUTILS-86?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12602580#action_12602580
] 

Guillaume Serre commented on DDLUTILS-86:
-----------------------------------------

Hello,

I also need this TYPE_NAME column to be retrieved. It is very useful in Oracle to identify
NVARCHAR2 columns, which in ddlutils-1.0 are mapped to Types.OTHER.

> New attribute of Column. Native type is a value of TYPE_NAME in the result set of DataBaseMetadata.getColumns(...).
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: DDLUTILS-86
>                 URL: https://issues.apache.org/jira/browse/DDLUTILS-86
>             Project: DdlUtils
>          Issue Type: New Feature
>          Components: Core (No specific database)
>            Reporter: Yauheni Prykhodzka
>            Assignee: Thomas Dudziak
>            Priority: Minor
>             Fix For: 1.2
>
>
> It was been discussing with Thomas Dudziak. We try to use DdlUtils to compare two and
more databases. In some cases we need the functionality of JDBC call DataBaseMetadata.getColumns(...).
This call returns among other things the native type of the column as well. Sometimes it's
different than hard coded predefined types for a platform. This difference is very important
if you compare two databases. Here is the begin of my email to Thomas about that problem:
> > i'm developing now a small tool that should compare
> > databases (of the same type). I need to get native
> > types possibly without any modifications. For example
> > the base implementation of DdlUtils returns SMALLINT
> > instead of TYNIINT for MySql. Probably i can get
> > SMALLINT both for TYNIINT and for some other native
> > type if i'll use the current implementation of
> > DdlUtils. So the result of the compare can be wrong in
> > this case!
> Here also changes of classes Column and JdbcModelReader.
> Column:
> 66,68d65
> <     
> <     /** native data type */
> <     private String _nativeDataType;
> 516,518d512
> <             
> <             // compare native data type
> <             comparator.append(_nativeDataType,         other.getNativeDataType());
> 554c548
> <         builder.append(_nativeDataType);
> ---
> >         builder.append(getParsedDefaultValue());
> 560,562d553
> <         // native data type
> <         builder.append(getNativeDataType());
> <         
> 577,579d567
> <         // native data type
> <         result.append("; native type=");
> <         result.append(_nativeDataType);
> 616,618d603
> <         // native data type
> <         result.append("; native type=");
> <         result.append(_nativeDataType);        
> 623,636d607
> < 
> < 	/**
> < 	 * @return Returns the _nativeDataType.
> < 	 */
> < 	public String getNativeDataType() {
> < 		return _nativeDataType;
> < 	}
> < 
> < 	/**
> < 	 * @param dataType The _nativeDataType to set.
> < 	 */
> < 	public void setNativeDataType(String dataType) {
> < 		_nativeDataType = dataType;
> < 	}
> JdbcModelReader:
> 184,185d183
> <         // native data type
> <         result.add(new MetaDataColumnDescriptor("TYPE_NAME",        Types.VARCHAR));
> 760,763d757
> <         
> <         // native data type
> <         column.setNativeDataType(((String)values.get("TYPE_NAME")).trim());
> <       
> Thanx,
> Yauheni Prykhodzka

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message