Bug 145679 [Regression]Failed to preview sqlserver data set with jtds1.1
Steps to reproduce: 1.Add jtds_1.1.jar to JAR Files, test connection, it's ok 2.New a data set, preview result Expected result: Data can be retrieved Actual result: A BIRT exception occurred. Plug-in Provider:Eclipse.org Plug-in Name:BIRT Data Engine Plug-in ID:org.eclipse.birt.data Version:2.1.0.N20060607-0632 Error Code:odaconsumer.CannotGetParameterMetaData Error Message:Cannot get ODA driver parameter metadata. Cannot retrieve the parameter metadata. The PreparedStatement.getParameterMetaData method is not implemented. Note: If change jtds_1.1 to jtds_0.9, it works.
data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/executor/DataSourceQuery.java
assert odaStatement != null;
				
		checkOutputParamNameValid( name );
		return odaStatement.getParameterValue( name );
	}
    
	/**
	 * In oda layer, it does not differentiate the value retrievation of input
	 * parameter value and ouput parameter value. They will be put in a same
	 * sequence list. However, in odi layer, we need to clearly distinguish them
	 * since only retrieving output parameter is suppored and it should be based
	 * on its own output parameter index. Therefore, this method will do such a
	 * conversion from the output parameter index to the parameter index.
	 * 
	 * @param index based on output parameter order
	 * @return index based on the whole parameters order
	 * @throws DataException
	 */
	private int getCorrectParamIndex( int index ) throws DataException
	{
		if ( index <= 0 )
			throw new DataException( ResourceConstants.INVALID_OUTPUT_PARAMETER_INDEX, new Integer(index) );
		
		int newIndex = 0; 
		int curOutputIndex = 0; 
		
		Collection collection = getParameterMetaData( );
		if ( collection != null )
		{
			Iterator it = collection.iterator( );