Index: test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTypeInfo_TotalNumber.expected
===================================================================
--- test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTypeInfo_TotalNumber.expected	(revision 3801)
+++ test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTypeInfo_TotalNumber.expected	(working copy)
@@ -17,8 +17,9 @@
 timestamp                                                          93           29           {ts'                                                               }                                                                  <null>                                                             1         false           3           true                true              false           timestamp                                                          0              255            <null>         <null>            0             
 object                                                             2000         2147483647   <null>                                                             <null>                                                             <null>                                                             1         false           3           true                true              false           object                                                             0              255            <null>         <null>            0             
 blob                                                               2004         2147483647   <null>                                                             <null>                                                             <null>                                                             1         false           3           true                true              false           blob                                                               0              255            <null>         <null>            0             
+varbinary                                                          -3           8192         X'                                                                 '                                                                  <null>                                                             1         false           3           true                true              false           varbinary                                                          0              255            <null>         <null>            0             
 clob                                                               2005         2147483647   <null>                                                             <null>                                                             <null>                                                             1         false           3           true                true              false           clob                                                               0              255            <null>         <null>            0             
-Row Count : 18
+Row Count : 19
 getColumnName       getColumnType  getCatalogName  getColumnClassName  getColumnLabel      getColumnTypeName  getSchemaName  getTableName  getColumnDisplaySize  getPrecision  getScale  isAutoIncrement  isCaseSensitive  isCurrency  isDefinitelyWritable  isNullable  isReadOnly  isSearchable  isSigned  isWritable  
 TYPE_NAME           12             QT_Ora9DS       java.lang.String    TYPE_NAME           string             SYS            DataTypes     4000                  4000          0         false            false            false       false                 0           true        true          false     false       
 DATA_TYPE           4              QT_Ora9DS       java.lang.Integer   DATA_TYPE           integer            SYS            DataTypes     11                    10            0         false            false            false       true                  1           false       true          true      true        
Index: test-integration/common/src/test/java/org/teiid/transport/TestJDBCSocketTransport.java
===================================================================
--- test-integration/common/src/test/java/org/teiid/transport/TestJDBCSocketTransport.java	(revision 3801)
+++ test-integration/common/src/test/java/org/teiid/transport/TestJDBCSocketTransport.java	(working copy)
@@ -109,6 +109,15 @@
 		assertEquals("<root></root>", s.getResultSet().getString(1));
 	}
 	
+	@Test public void testVarbinary() throws Exception {
+		Statement s = conn.createStatement();
+		assertTrue(s.execute("select X'aab1'"));
+		s.getResultSet().next();
+		byte[] bytes = s.getResultSet().getBytes(1);
+		assertArrayEquals(new byte[] {(byte)0xaa, (byte)0xb1}, bytes);
+		assertArrayEquals(bytes, s.getResultSet().getBlob(1).getBytes(1, 2));
+	}
+	
 	@Test public void testXmlTableScrollable() throws Exception {
 		Statement s = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
 		assertTrue(s.execute("select * from xmltable('/root/row' passing (select xmlelement(name \"root\", xmlagg(xmlelement(name \"row\", xmlforest(t.name)) order by t.name)) from tables as t, columns as t1) columns \"Name\" string) as x"));
Index: engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
===================================================================
--- engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java	(revision 3801)
+++ engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java	(working copy)
@@ -52,7 +52,6 @@
 import org.teiid.core.types.DataTypeManager;
 import org.teiid.dqp.internal.process.DQPCore.CompletionListener;
 import org.teiid.dqp.internal.process.DQPCore.FutureWork;
-import org.teiid.dqp.internal.process.DQPWorkContext.Version;
 import org.teiid.dqp.internal.process.SessionAwareCache.CacheID;
 import org.teiid.dqp.internal.process.ThreadReuseExecutor.PrioritizedRunnable;
 import org.teiid.dqp.message.AtomicRequestID;
@@ -714,7 +713,7 @@
             dataTypes[i] = DataTypeManager.getDataTypeName(symbol.getType());
         }
         ResultsMessage result = new ResultsMessage(batch, columnNames, dataTypes);
-        result.setClientSerializationVersion((byte)(this.dqpWorkContext.getClientVersion().compareTo(Version.SEVEN_6) >= 0?1:0));
+        result.setClientSerializationVersion(this.dqpWorkContext.getClientVersion().getClientSerializationVersion());
         setAnalysisRecords(result);
         return result;
     }
Index: common-core/src/main/java/org/teiid/core/types/basic/BinaryToBlobTransform.java
===================================================================
--- common-core/src/main/java/org/teiid/core/types/basic/BinaryToBlobTransform.java	(revision 0)
+++ common-core/src/main/java/org/teiid/core/types/basic/BinaryToBlobTransform.java	(revision 0)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.core.types.basic;
+
+import org.teiid.core.types.BinaryType;
+import org.teiid.core.types.DataTypeManager;
+import org.teiid.core.types.Transform;
+import org.teiid.core.types.TransformationException;
+
+public class BinaryToBlobTransform extends Transform {
+
+	/**
+	 * This method transforms a value of the source type into a value
+	 * of the target type.
+	 * @param value Incoming value of source type
+	 * @return Outgoing value of target type
+	 * @throws TransformationException if value is an incorrect input type or
+	 * the transformation fails
+	 */
+	public Object transformDirect(Object value) throws TransformationException {
+        BinaryType contents = (BinaryType)value;                
+		return contents.toBlob();
+	}
+
+	/**
+	 * Type of the incoming value.
+	 * @return Source type
+	 */
+	public Class<?> getSourceType() {
+		return DataTypeManager.DefaultDataClasses.VARBINARY;
+	}
+
+	/**
+	 * Type of the outgoing value.
+	 * @return Target type
+	 */
+	public Class<?> getTargetType() {
+		return DataTypeManager.DefaultDataClasses.BLOB;
+	}
+	
+}
Index: client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java
===================================================================
--- client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java	(revision 3801)
+++ client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java	(working copy)
@@ -26,23 +26,10 @@
 import java.io.Reader;
 import java.math.BigDecimal;
 import java.net.URL;
-import java.sql.Array;
-import java.sql.Blob;
-import java.sql.CallableStatement;
-import java.sql.Clob;
-import java.sql.Date;
-import java.sql.NClob;
-import java.sql.Ref;
-import java.sql.RowId;
-import java.sql.SQLException;
-import java.sql.SQLXML;
-import java.sql.Time;
-import java.sql.Timestamp;
+import java.sql.*;
 import java.util.Calendar;
 import java.util.Map;
 
-import javax.sql.rowset.serial.SerialBlob;
-
 import org.teiid.client.RequestMessage;
 import org.teiid.client.RequestMessage.ResultsMode;
 import org.teiid.client.RequestMessage.StatementType;
@@ -545,7 +532,7 @@
 	}
 
 	public void setBytes(String parameterName, byte[] x) throws SQLException {
-		setObject((Object)parameterName, new SerialBlob(x));
+		setObject((Object)parameterName, x);
 	}
 
 	public void setCharacterStream(String parameterName, Reader reader)
Index: test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetColumns.expected
===================================================================
--- test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetColumns.expected	(revision 3801)
+++ test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetColumns.expected	(working copy)
@@ -35,7 +35,7 @@
 QT_Ora9DS                                                          XQTDoc                                                             BQTDocTestDocument.MappingClasses.SingleRow                        ShortValue                                                         5          short                                                              5            <null>                                                             0            0            1            <null>                                                             <null>                                                             <null>                                                             <null>                                                             0                14           YES                                                                <null>                                                             <null>                                                             <null>                                                             <null>                                                             NO                                                               
 QT_Ora9DS                                                          XQTDoc                                                             BQTDocTestDocument.MappingClasses.SingleRow                        BigIntegerValue                                                    2          biginteger                                                         19           <null>                                                             0            0            1            <null>                                                             <null>                                                             <null>                                                             <null>                                                             0                15           YES                                                                <null>                                                             <null>                                                             <null>                                                             <null>                                                             NO                                                               
 QT_Ora9DS                                                          XQTDoc                                                             BQTDocTestDocument.MappingClasses.SingleRow                        BigDecimalValue                                                    2          bigdecimal                                                         20           <null>                                                             0            0            1            <null>                                                             <null>                                                             <null>                                                             <null>                                                             0                16           YES                                                                <null>                                                             <null>                                                             <null>                                                             <null>                                                             NO                                                               
-QT_Ora9DS                                                          XQTDoc                                                             BQTDocTestDocument.MappingClasses.SingleRow                        ObjectValue                                                        <null>     <null>                                                             <null>       <null>                                                             0            0            1            <null>                                                             <null>                                                             <null>                                                             <null>                                                             0                17           YES                                                                <null>                                                             <null>                                                             <null>                                                             <null>                                                             NO                                                               
+QT_Ora9DS                                                          XQTDoc                                                             BQTDocTestDocument.MappingClasses.SingleRow                        ObjectValue                                                        0          <null>                                                             1            <null>                                                             0            0            1            <null>                                                             <null>                                                             <null>                                                             <null>                                                             0                17           YES                                                                <null>                                                             <null>                                                             <null>                                                             <null>                                                             NO                                                               
 QT_Ora9DS                                                          VQT                                                                Base.Agg1                                                          StringNum                                                          12         string                                                             10           <null>                                                             0            10           1            <null>                                                             <null>                                                             <null>                                                             <null>                                                             10               1            YES                                                                <null>                                                             <null>                                                             <null>                                                             <null>                                                             NO                                                               
 QT_Ora9DS                                                          VQT                                                                Base.Agg2                                                          StringNum                                                          12         string                                                             10           <null>                                                             0            10           1            <null>                                                             <null>                                                             <null>                                                             <null>                                                             10               1            YES                                                                <null>                                                             <null>                                                             <null>                                                             <null>                                                             NO                                                               
 QT_Ora9DS                                                          VQT                                                                Base.Agg3                                                          count                                                              4          integer                                                            10           <null>                                                             0            10           0            <null>                                                             <null>                                                             <null>                                                             <null>                                                             1                1            NO                                                                 <null>                                                             <null>                                                             <null>                                                             <null>                                                             NO                                                               
Index: test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testTypeInfo.expected
===================================================================
--- test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testTypeInfo.expected	(revision 3801)
+++ test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testTypeInfo.expected	(working copy)
@@ -17,8 +17,9 @@
 timestamp                                                          93           29           {ts'                                                               }                                                                  <null>                                                             1         false           3           true                true              false           timestamp                                                          0              255            <null>         <null>            0             
 object                                                             2000         2147483647   <null>                                                             <null>                                                             <null>                                                             1         false           3           true                true              false           object                                                             0              255            <null>         <null>            0             
 blob                                                               2004         2147483647   <null>                                                             <null>                                                             <null>                                                             1         false           3           true                true              false           blob                                                               0              255            <null>         <null>            0             
+varbinary                                                          -3           8192         X'                                                                 '                                                                  <null>                                                             1         false           3           true                true              false           varbinary                                                          0              255            <null>         <null>            0             
 clob                                                               2005         2147483647   <null>                                                             <null>                                                             <null>                                                             1         false           3           true                true              false           clob                                                               0              255            <null>         <null>            0             
-Row Count : 18
+Row Count : 19
 getColumnName       getColumnType  getCatalogName  getColumnClassName  getColumnLabel      getColumnTypeName  getSchemaName  getTableName  getColumnDisplaySize  getPrecision  getScale  isAutoIncrement  isCaseSensitive  isCurrency  isDefinitelyWritable  isNullable  isReadOnly  isSearchable  isSigned  isWritable  
 TYPE_NAME           12             PartsSupplier   java.lang.String    TYPE_NAME           string             SYS            DataTypes     4000                  4000          0         false            false            false       false                 0           true        true          false     false       
 DATA_TYPE           4              PartsSupplier   java.lang.Integer   DATA_TYPE           integer            SYS            DataTypes     11                    10            0         false            false            false       true                  1           false       true          true      true        
Index: common-core/src/main/java/org/teiid/core/types/DataTypeManager.java
===================================================================
--- common-core/src/main/java/org/teiid/core/types/DataTypeManager.java	(revision 3801)
+++ common-core/src/main/java/org/teiid/core/types/DataTypeManager.java	(working copy)
@@ -190,6 +190,7 @@
 		public static final String BLOB = "blob"; //$NON-NLS-1$
 		public static final String CLOB = "clob"; //$NON-NLS-1$
 		public static final String XML = "xml"; //$NON-NLS-1$
+		public static final String VARBINARY = "varbinary"; //$NON-NLS-1$
 	}
 
 	public static final class DefaultDataClasses {
@@ -212,6 +213,7 @@
 		public static final Class<BlobType> BLOB = BlobType.class;
 		public static final Class<ClobType> CLOB = ClobType.class;
 		public static final Class<XMLType> XML = XMLType.class;
+		public static final Class<BinaryType> VARBINARY = BinaryType.class;
 	}
 	
 	public static final class DefaultTypeCodes {
@@ -234,9 +236,10 @@
 		public static final int CLOB = 16;
 		public static final int XML = 17;
 		public static final int NULL = 18;
+		public static final int VARBINARY = 19;
 	}
 	
-	public static int MAX_TYPE_CODE = DefaultTypeCodes.NULL;
+	public static int MAX_TYPE_CODE = DefaultTypeCodes.VARBINARY;
 	
     private static final Map<Class<?>, Integer> typeMap = new LinkedHashMap<Class<?>, Integer>(64);
     private static final List<Class<?>> typeList;
@@ -261,15 +264,24 @@
         typeMap.put(DataTypeManager.DefaultDataClasses.CLOB, DefaultTypeCodes.CLOB);
         typeMap.put(DataTypeManager.DefaultDataClasses.XML, DefaultTypeCodes.XML);
         typeMap.put(DataTypeManager.DefaultDataClasses.NULL, DefaultTypeCodes.NULL);
+        typeMap.put(DataTypeManager.DefaultDataClasses.VARBINARY, DefaultTypeCodes.VARBINARY);
         typeList = new ArrayList<Class<?>>(typeMap.keySet());
     }    
     
     public static int getTypeCode(Class<?> source) {
-        return typeMap.get(source).intValue();
+    	Integer result = typeMap.get(source);
+    	if (result == null) {
+    		return DefaultTypeCodes.OBJECT;
+    	}
+        return result;
     }
     
     public static Class<?> getClass(int code) {
-    	return typeList.get(code);
+    	Class<?> result = typeList.get(code);
+    	if (result == null) {
+    		return DefaultDataClasses.OBJECT;
+    	}
+    	return result;
     }
 
 	/**
@@ -568,6 +580,7 @@
 		DataTypeManager.addDataType(DefaultDataTypes.OBJECT, DefaultDataClasses.OBJECT);
 		DataTypeManager.addDataType(DefaultDataTypes.NULL, DefaultDataClasses.NULL);
 		DataTypeManager.addDataType(DefaultDataTypes.BLOB, DefaultDataClasses.BLOB);
+		DataTypeManager.addDataType(DefaultDataTypes.VARBINARY, DefaultDataClasses.VARBINARY);
 		DATA_TYPE_NAMES = Collections.unmodifiableSet(new LinkedHashSet<String>(dataTypeNames.keySet()));
 		dataTypeNames.put(DataTypeAliases.BIGINT, DefaultDataClasses.LONG);
 		dataTypeNames.put(DataTypeAliases.DECIMAL, DefaultDataClasses.BIG_DECIMAL);
@@ -600,8 +613,9 @@
 			valueMaps.put(DefaultDataClasses.DATE, new HashedValueCache<Date>(14));
 			valueMaps.put(DefaultDataClasses.TIME, new HashedValueCache<Time>(14));
 			valueMaps.put(DefaultDataClasses.TIMESTAMP, new HashedValueCache<Timestamp>(14));
-			valueMaps.put(DefaultDataClasses.BIG_DECIMAL, new WeakReferenceHashedValueCache<BigDecimal>(16));
+			valueMaps.put(DefaultDataClasses.BIG_DECIMAL, new WeakReferenceHashedValueCache<BigDecimal>(17));
 			valueMaps.put(DefaultDataClasses.STRING, stringCache);
+			valueMaps.put(DefaultDataClasses.VARBINARY, new WeakReferenceHashedValueCache<BinaryType>(17));
 		}
 	}
 
@@ -727,8 +741,12 @@
 		DataTypeManager.addTransform(new org.teiid.core.types.basic.StringToCharacterTransform());
 		DataTypeManager.addTransform(new org.teiid.core.types.basic.StringToClobTransform());
 		DataTypeManager.addTransform(new org.teiid.core.types.basic.StringToSQLXMLTransform());
-		
+
+		DataTypeManager.addTransform(new org.teiid.core.types.basic.BinaryToBlobTransform());
+
 		DataTypeManager.addTransform(new org.teiid.core.types.basic.ClobToStringTransform());
+
+		DataTypeManager.addTransform(new org.teiid.core.types.basic.BlobToBinaryTransform());
 		
 		DataTypeManager.addTransform(new org.teiid.core.types.basic.SQLXMLToStringTransform());
 		
@@ -752,28 +770,28 @@
 	}
 
 	static void loadSourceConversions() {
-		sourceConverters.put(Clob.class, new SourceTransform<Clob, ClobType>() {
+		addSourceTransform(Clob.class, new SourceTransform<Clob, ClobType>() {
 			@Override
 			public ClobType transform(Clob value) {
 				return new ClobType(value);
 			}
 		});
-		sourceConverters.put(char[].class, new SourceTransform<char[], ClobType>() {
+		addSourceTransform(char[].class, new SourceTransform<char[], ClobType>() {
 			@Override
 			public ClobType transform(char[] value) {
 				return new ClobType(ClobType.createClob(value));
 			}
 		});
-		sourceConverters.put(Blob.class, new SourceTransform<Blob, BlobType>() {
+		addSourceTransform(Blob.class, new SourceTransform<Blob, BlobType>() {
 			@Override
 			public BlobType transform(Blob value) {
 				return new BlobType(value);
 			}
 		});
-		addSourceTransform(byte[].class, new SourceTransform<byte[], BlobType>() {
+		addSourceTransform(byte[].class, new SourceTransform<byte[], BinaryType>() {
 			@Override
-			public BlobType transform(byte[] value) {
-				return new BlobType(BlobType.createBlob(value));
+			public BinaryType transform(byte[] value) {
+				return new BinaryType(value);
 			}
 		});
 		addSourceTransform(SQLXML.class, new SourceTransform<SQLXML, XMLType>() {
Index: client/src/main/java/org/teiid/client/BatchSerializer.java
===================================================================
--- client/src/main/java/org/teiid/client/BatchSerializer.java	(revision 3801)
+++ client/src/main/java/org/teiid/client/BatchSerializer.java	(working copy)
@@ -40,6 +40,7 @@
 import java.util.TimeZone;
 
 import org.teiid.core.TeiidRuntimeException;
+import org.teiid.core.types.BinaryType;
 import org.teiid.core.types.BlobType;
 import org.teiid.core.types.ClobType;
 import org.teiid.core.types.DataTypeManager;
@@ -72,6 +73,7 @@
         serializers.put(DataTypeManager.DefaultDataTypes.SHORT,         new ShortColumnSerializer());
         serializers.put(DataTypeManager.DefaultDataTypes.TIME,          new TimeColumnSerializer());
         serializers.put(DataTypeManager.DefaultDataTypes.TIMESTAMP,     new TimestampColumnSerializer());
+        serializers.put(DataTypeManager.DefaultDataTypes.VARBINARY,     new BinaryColumnSerializer());
     }
     
     private static final Map<String, ColumnSerializer> version1serializers = new HashMap<String, ColumnSerializer>(128);
@@ -84,9 +86,46 @@
     	version1serializers.put(DataTypeManager.DefaultDataTypes.XML,     		new XmlColumnSerializer1());
     	version1serializers.put(DataTypeManager.DefaultDataTypes.NULL,     		new NullColumnSerializer1());
     	version1serializers.put(DataTypeManager.DefaultDataTypes.OBJECT,     	new ObjectColumnSerializer1());
+    	version1serializers.put(DataTypeManager.DefaultDataTypes.VARBINARY,     new BinaryColumnSerializer1());
     }
     
-    public static final class ObjectColumnSerializer1 extends ColumnSerializer {
+    static class BinaryColumnSerializer1 extends ColumnSerializer {
+		@Override
+		protected void writeObject(ObjectOutput out, Object obj)
+				throws IOException {
+			byte[] bytes = ((BinaryType)obj).getBytes();
+			out.writeInt(bytes.length); //in theory this could be a short, but we're not strictly enforcing the length
+			out.write(bytes);
+		}
+		
+		@Override
+		protected Object readObject(ObjectInput in) throws IOException,
+				ClassNotFoundException {
+			int length = in.readInt();
+			byte[] bytes = new byte[length];
+			in.readFully(bytes);
+			return new BinaryType(bytes);
+		}
+	}
+    
+    static class BinaryColumnSerializer extends ColumnSerializer {
+		@Override
+		protected void writeObject(ObjectOutput out, Object obj)
+				throws IOException {
+			//uses object serialization for compatibility with legacy clients
+			super.writeObject(out, ((BinaryType)obj).getBytesDirect());
+		}
+		
+		@Override
+		protected Object readObject(ObjectInput in) throws IOException,
+				ClassNotFoundException {
+			//won't actually be used
+			byte[] bytes = (byte[])super.readObject(in);
+			return new BinaryType(bytes);
+		}
+	}
+
+	public static final class ObjectColumnSerializer1 extends ColumnSerializer {
     	
     	@Override
     	protected void writeObject(ObjectOutput out, Object obj)
@@ -532,7 +571,12 @@
         if (batch == null) {
             out.writeInt(-1);
         } else {
-            out.writeInt(batch.size());
+        	if (version > 0 && batch.size() > 0) {
+                out.writeInt(-batch.size() -1);
+                out.writeByte(version);
+        	} else {
+                out.writeInt(batch.size());
+        	}
             if (batch.size() > 0) {
 	            int columns = types.length;
 	            out.writeInt(columns);
@@ -558,27 +602,29 @@
     }
     
     public static List<List<Object>> readBatch(ObjectInput in, String[] types) throws IOException, ClassNotFoundException {
-    	return readBatch(in, types, (byte)1);
-    }
-    
-    public static List<List<Object>> readBatch(ObjectInput in, String[] types, byte version) throws IOException, ClassNotFoundException {
         int rows = in.readInt();
         if (rows == 0) {
             return new ArrayList<List<Object>>(0);
-        } else if (rows > 0) {
-            int columns = in.readInt();
-            List<List<Object>> batch = new ResizingArrayList<List<Object>>(rows);
-            int numBytes = rows/8;
-            int extraRows = rows % 8;
-            for (int currentRow = 0; currentRow < rows; currentRow++) {
-                batch.add(currentRow, Arrays.asList(new Object[columns]));
-            }
-            byte[] isNullBuffer = new byte[(extraRows > 0) ? numBytes + 1: numBytes];
-            for (int col = 0; col < columns; col++) {
-                getSerializer(types[col], version).readColumn(in, col, batch, isNullBuffer);
-            }
-            return batch;
+        }
+        if (rows == -1) {
+        	return null;
         }
-        return null;
+        byte version = (byte)0;
+        if (rows < 0) {
+        	rows = -(rows+1);
+        	version = in.readByte();
+        } 
+        int columns = in.readInt();
+        List<List<Object>> batch = new ResizingArrayList<List<Object>>(rows);
+        int numBytes = rows/8;
+        int extraRows = rows % 8;
+        for (int currentRow = 0; currentRow < rows; currentRow++) {
+            batch.add(currentRow, Arrays.asList(new Object[columns]));
+        }
+        byte[] isNullBuffer = new byte[(extraRows > 0) ? numBytes + 1: numBytes];
+        for (int col = 0; col < columns; col++) {
+            getSerializer(types[col], version).readColumn(in, col, batch, isNullBuffer);
+        }
+        return batch;
     }
 }
Index: client/src/main/resources/org/teiid/jdbc/i18n.properties
===================================================================
--- client/src/main/resources/org/teiid/jdbc/i18n.properties	(revision 3801)
+++ client/src/main/resources/org/teiid/jdbc/i18n.properties	(working copy)
@@ -24,7 +24,6 @@
 
 DataTypeTransformer.Err_converting=Unable to transform the column value {0} to a {1}.
 JDBC.Method_not_supported=This method is not supported.
-MMPreparedStatement.Err_transform_obj=Unable to transform the object into the target JDBC type.
 MMCallableStatement.Param_not_found=Parameter {0} was not found.
 MMConnection.Err_closing_stmts=Error trying to close statements on this connection.
 MMConnection.Cant_use_closed_connection=Cannot perform operations on a closed connection.
Index: api/src/main/java/org/teiid/language/visitor/SQLStringVisitor.java
===================================================================
--- api/src/main/java/org/teiid/language/visitor/SQLStringVisitor.java	(revision 3801)
+++ api/src/main/java/org/teiid/language/visitor/SQLStringVisitor.java	(working copy)
@@ -634,6 +634,10 @@
                 buffer.append("{d '") //$NON-NLS-1$
                       .append(val)
                       .append("'}"); //$NON-NLS-1$
+            } else if (type.equals(DataTypeManager.DefaultDataClasses.VARBINARY)) {
+            	buffer.append("X'") //$NON-NLS-1$
+            		  .append(val)
+            		  .append("'"); //$NON-NLS-1$
             } else {
                 buffer.append(Tokens.QUOTE)
                       .append(escapeString(val, Tokens.QUOTE))
Index: engine/src/test/java/org/teiid/query/parser/TestParser.java
===================================================================
--- engine/src/test/java/org/teiid/query/parser/TestParser.java	(revision 3801)
+++ engine/src/test/java/org/teiid/query/parser/TestParser.java	(working copy)
@@ -5205,7 +5205,13 @@
     
     @Test public void testExactFixedPoint() throws QueryParserException {
 		Query actualCommand = (Query)QueryParser.getQueryParser().parseCommand("SELECT 1.1", new ParseInfo());
-		assertEquals(DataTypeManager.DefaultDataClasses.BIG_DECIMAL, ((Expression)actualCommand.getSelect().getSymbol(0)).getType());
+		assertEquals(DataTypeManager.DefaultDataClasses.BIG_DECIMAL, actualCommand.getSelect().getSymbol(0).getType());
+    }
+    
+    @Test public void testBinaryStringLiteral() throws QueryParserException {
+		Query actualCommand = (Query)QueryParser.getQueryParser().parseCommand("SELECT x'AABBCC0a'", new ParseInfo());
+		assertEquals(DataTypeManager.DefaultDataClasses.VARBINARY, actualCommand.getSelect().getSymbol(0).getType());
+		assertEquals("SELECT X'AABBCC0A'", actualCommand.toString());
     }
 
 }
Index: engine/src/test/java/org/teiid/common/buffer/impl/TestSizeUtility.java
===================================================================
--- engine/src/test/java/org/teiid/common/buffer/impl/TestSizeUtility.java	(revision 3801)
+++ engine/src/test/java/org/teiid/common/buffer/impl/TestSizeUtility.java	(working copy)
@@ -34,6 +34,7 @@
 import java.util.List;
 
 import org.junit.Test;
+import org.teiid.core.types.BinaryType;
 import org.teiid.core.types.DataTypeManager;
 
 public class TestSizeUtility {
@@ -144,7 +145,7 @@
     
     @Test public void testGetSizeByteArray() {
         byte[] bytes = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
-        helpTestGetSize(bytes, 32);
+        helpTestGetSize(new BinaryType(bytes), 32);
     }
     
     @Test public void testResultSet() {
Index: common-core/src/main/java/org/teiid/core/types/BinaryType.java
===================================================================
--- common-core/src/main/java/org/teiid/core/types/BinaryType.java	(revision 0)
+++ common-core/src/main/java/org/teiid/core/types/BinaryType.java	(revision 0)
@@ -0,0 +1,112 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.core.types;
+
+import java.util.Arrays;
+
+import javax.xml.bind.DatatypeConverter;
+
+import org.teiid.core.util.Assertion;
+
+public class BinaryType implements Comparable<BinaryType> {
+	
+	private byte[] bytes;
+	
+	public BinaryType(byte[] bytes) {
+		Assertion.isNotNull(bytes);
+		//to be truly immutable we should clone here
+		this.bytes = bytes;
+	}
+	
+	/**
+	 * 
+	 * @return the actual bytes - no modifications should be performed
+	 */
+	public byte[] getBytesDirect() {
+		return this.bytes;
+	}
+	
+	/**
+	 * 
+	 * @return a copy of the bytes
+	 */
+	public byte[] getBytes() {
+		return Arrays.copyOf(bytes, bytes.length);
+	}
+	
+	/**
+	 * Get the byte value at a given index
+	 * @param index
+	 * @return
+	 */
+	public byte getByte(int index) {
+		return bytes[index]; 
+	}
+	
+	public int getLength() {
+		return bytes.length;
+	}
+	
+	@Override
+	public int compareTo(BinaryType o) {
+		int len1 = getLength();
+		int len2 = o.getLength();
+		int n = Math.min(len1, len2);
+	    for (int i = 0; i < n; i++) {
+	    	//unsigned comparison
+			int b1 = bytes[i] & 0xff;
+			int b2 = o.bytes[i] & 0xff;
+			if (b1 != b2) {
+			    return b1 - b2;
+			}
+	    }
+		return len1 - len2;
+	}
+	
+	@Override
+	public int hashCode() {
+		return Arrays.hashCode(bytes);
+	}
+	
+	@Override
+	public boolean equals(Object obj) {
+		if (obj == this) {
+			return true;
+		}
+		if (!(obj instanceof BinaryType)) {
+			return false;
+		}
+		BinaryType other = (BinaryType)obj;
+		return Arrays.equals(this.bytes, other.bytes);
+	}
+	
+	@Override
+	public String toString() {
+		return DatatypeConverter.printHexBinary(bytes);
+	}
+	
+	public BlobType toBlob() {
+		return new BlobType(BlobType.createBlob(bytes));
+	}
+
+}
Index: client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java
===================================================================
--- client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java	(revision 3801)
+++ client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java	(working copy)
@@ -32,12 +32,13 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.logging.Logger;
 
 import org.teiid.client.metadata.ResultsMetadataConstants;
-import org.teiid.client.metadata.ResultsMetadataDefaults;
 import org.teiid.core.CoreConstants;
 import org.teiid.core.types.DataTypeManager;
 import org.teiid.core.types.JDBCSQLTypeInfo;
@@ -118,16 +119,17 @@
     private static final String PRECISION_MAPPING;
 
     static {
-        String[] internalTypes = JDBCSQLTypeInfo.getMMTypeNames();
+        Set<String> internalTypes = JDBCSQLTypeInfo.getMMTypeNames();
         StringBuffer typeMapping = new StringBuffer();
         StringBuffer precisionMapping = new StringBuffer();
-        for (int i = 0; i < internalTypes.length; i++) {
-            if (i != 0) {
+        for (Iterator<String> iter = internalTypes.iterator(); iter.hasNext();) {
+        	String type = iter.next();
+            typeMapping.append(type).append(",").append(JDBCSQLTypeInfo.getSQLType(type)); //$NON-NLS-1$
+            precisionMapping.append(type).append(",").append(JDBCSQLTypeInfo.getDefaultPrecision(type)); //$NON-NLS-1$
+            if (iter.hasNext()) {
                 typeMapping.append(","); //$NON-NLS-1$
                 precisionMapping.append(","); //$NON-NLS-1$
             }
-            typeMapping.append(internalTypes[i]).append(",").append(JDBCSQLTypeInfo.getSQLType(internalTypes[i])); //$NON-NLS-1$
-            precisionMapping.append(internalTypes[i]).append(",").append(ResultsMetadataDefaults.getDefaultPrecision(internalTypes[i])); //$NON-NLS-1$
         }
         TYPE_MAPPING = typeMapping.toString();
         PRECISION_MAPPING = precisionMapping.toString();
@@ -392,35 +394,35 @@
 
         // HardCoding metadata details for SCOPE column
         metadataList[0] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.BEST_ROW.SCOPE,
-                            JDBCSQLTypeInfo.SHORT,  ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
+                            DataTypeManager.DefaultDataTypes.SHORT,  ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
 
         // HardCoding metadata details for COLUMN_NAME column
         metadataList[1] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.BEST_ROW.COLUMN_NAME,
-                            JDBCSQLTypeInfo.STRING,  ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING,  ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
 
         // HardCoding metadata details for DATA_TYPE column
         metadataList[2] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.BEST_ROW.DATA_TYPE,
-                            JDBCSQLTypeInfo.SHORT, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
+                            DataTypeManager.DefaultDataTypes.SHORT, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
 
         // HardCoding metadata details for TYPE_NAME column
         metadataList[3] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.BEST_ROW.TYPE_NAME,
-                            JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
 
         // HardCoding metadata details for COLUMN_SIZE column
         metadataList[4] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.BEST_ROW.COLUMN_SIZE,
-                            JDBCSQLTypeInfo.INTEGER, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
+                            DataTypeManager.DefaultDataTypes.INTEGER, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
 
         // HardCoding metadata details for BUFFER_LENGTH column
         metadataList[5] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.BEST_ROW.BUFFER_LENGTH,
-                            JDBCSQLTypeInfo.INTEGER, ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
+                            DataTypeManager.DefaultDataTypes.INTEGER, ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
 
         // HardCoding metadata details for DECIMAL_DIGITS column
         metadataList[6] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.BEST_ROW.DECIMAL_DIGITS,
-                            JDBCSQLTypeInfo.SHORT, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
+                            DataTypeManager.DefaultDataTypes.SHORT, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
 
         // HardCoding metadata details for PSEUDO_COLUMN column
         metadataList[7] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.BEST_ROW.PSEUDO_COLUMN,
-                            JDBCSQLTypeInfo.SHORT, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
+                            DataTypeManager.DefaultDataTypes.SHORT, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
 
         // logging
         String logMsg = JDBCPlugin.Util.getString("MMDatabaseMetadata.Best_row_sucess", table); //$NON-NLS-1$
@@ -442,7 +444,7 @@
 
         // HardCoding metadata details for TABLE_CAT column
         metadataList[0] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.CATALOGS.TABLE_CAT, 
-                            JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
 
         // logging
         String logMsg = JDBCPlugin.Util.getString("MMDatabaseMetadata.Catalog_success"); //$NON-NLS-1$
@@ -486,21 +488,21 @@
         Map[] metadataList = new Map[8];
 
         metadataList[0] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.PRIVILEGES.TABLE_CAT,
-                            JDBCSQLTypeInfo.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
         metadataList[1] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.PRIVILEGES.TABLE_SCHEM,
-                            JDBCSQLTypeInfo.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
         metadataList[2] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.PRIVILEGES.TABLE_NAME,
-                            JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
         metadataList[3] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.PRIVILEGES.COLUMN_NAME,
-                             JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
+                             DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
         metadataList[4] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.PRIVILEGES.GRANTOR,
-                            JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
         metadataList[5] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.PRIVILEGES.GRANTEE,
-                            JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
         metadataList[6] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.PRIVILEGES.PRIVILEGE,
-                            JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
         metadataList[7] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.PRIVILEGES.IS_GRANTABLE,
-                            JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
        
         return dummyStatement().createResultSet(records, metadataList);
         
@@ -1319,19 +1321,19 @@
 
         // HardCoding metadata details for TABLE_CAT column
         metadataList[0] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.SUPER_TABLES.TABLE_CAT,
-                            JDBCSQLTypeInfo.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
 
         // HardCoding metadata details for TABLE_SCHEM column
         metadataList[1] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.SUPER_TABLES.TABLE_SCHEM,
-                            JDBCSQLTypeInfo.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
 
         // HardCoding metadata details for TABLE_NAME column
         metadataList[2] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.SUPER_TABLES.TABLE_NAME,
-                            JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
 
         // HardCoding metadata details for SUPERTABLE_NAME column
         metadataList[3] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.SUPER_TABLES.SUPERTABLE_NAME,
-                            JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
 
         // construct results object from column values and their metadata
         return dummyStatement().createResultSet(records, metadataList);
@@ -1357,27 +1359,27 @@
 
         // HardCoding metadata details for TYPE_CAT column
         metadataList[0] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.SUPER_TYPES.TYPE_CAT,
-                            JDBCSQLTypeInfo.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
 
         // HardCoding metadata details for TYPE_SCHEM column
         metadataList[1] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.SUPER_TYPES.TYPE_SCHEM,
-                            JDBCSQLTypeInfo.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
 
         // HardCoding metadata details for TYPE_NAME column
         metadataList[2] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.SUPER_TYPES.TYPE_NAME,
-                            JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
 
         // HardCoding metadata details for SUPERTYPE_CAT column
         metadataList[3] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.SUPER_TYPES.SUPERTYPE_CAT,
-                            JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
 
         // HardCoding metadata details for SUPERTYPE_SCHEM column
         metadataList[4] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.SUPER_TYPES.SUPERTYPE_SCHEM,
-                            JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
         
         // HardCoding metadata details for SUPERTYPE_NAME column
         metadataList[5] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.SUPER_TYPES.SUPERTYPE_NAME,
-                            JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
         
         // construct results object from column values and their metadata
         return dummyStatement().createResultSet(records, metadataList);
@@ -1395,19 +1397,19 @@
         Map[] metadataList = new Map[7];
 
         metadataList[0] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.PRIVILEGES.TABLE_CAT,
-                            JDBCSQLTypeInfo.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
         metadataList[1] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.PRIVILEGES.TABLE_SCHEM,
-                            JDBCSQLTypeInfo.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
         metadataList[2] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.PRIVILEGES.TABLE_NAME,
-                            JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
         metadataList[3] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.PRIVILEGES.GRANTOR,
-                            JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
         metadataList[4] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.PRIVILEGES.GRANTEE,
-                            JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
         metadataList[5] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.PRIVILEGES.PRIVILEGE,
-                            JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
         metadataList[6] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.PRIVILEGES.IS_GRANTABLE,
-                            JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, driverConnection);
        
         return dummyStatement().createResultSet(records, metadataList);
         
@@ -1529,7 +1531,7 @@
         Map[] metadataList = new Map[1];
 
         metadataList[0] = StatementImpl.getColumnMetadata(null, JDBCColumnNames.TABLE_TYPES.TABLE_TYPE, 
-                            JDBCSQLTypeInfo.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
+                            DataTypeManager.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, driverConnection);
 
         logger.fine(JDBCPlugin.Util.getString("MMDatabaseMetadata.getTableType_success")); //$NON-NLS-1$
 
@@ -1563,28 +1565,29 @@
         records.add(Arrays.asList(createTypeInfoRow("timestamp",  "{ts'", "}", Boolean.TRUE, Boolean.TRUE, 0))); //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$
         records.add(Arrays.asList(createTypeInfoRow("object", null, null, Boolean.TRUE, Boolean.TRUE, 0))); //$NON-NLS-1$ 
         records.add(Arrays.asList(createTypeInfoRow("blob", null, null, Boolean.TRUE, Boolean.TRUE, 0))); //$NON-NLS-1$ 
+        records.add(Arrays.asList(createTypeInfoRow("varbinary", "X'", "'", Boolean.TRUE, Boolean.TRUE, 0))); //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$
         records.add(Arrays.asList(createTypeInfoRow("clob", null, null, Boolean.TRUE, Boolean.TRUE, 0))); //$NON-NLS-1$ 
 
         Map[] metadataList = new Map[18];
 
-        metadataList[0] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.TYPE_NAME, JDBCSQLTypeInfo.STRING,  ResultsMetadataConstants.NULL_TYPES.NOT_NULL, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
-        metadataList[1] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.DATA_TYPE, JDBCSQLTypeInfo.INTEGER,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
-        metadataList[2] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.PRECISION, JDBCSQLTypeInfo.INTEGER,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
-        metadataList[3] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.LITERAL_PREFIX, JDBCSQLTypeInfo.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE,  ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
-        metadataList[4] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.LITERAL_SUFFIX, JDBCSQLTypeInfo.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE,  ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
-        metadataList[5] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.CREATE_PARAMS, JDBCSQLTypeInfo.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE,  ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
-        metadataList[6] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.NULLABLE, JDBCSQLTypeInfo.SHORT,  ResultsMetadataConstants.NULL_TYPES.NULLABLE,  ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
-        metadataList[7] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.CASE_SENSITIVE, JDBCSQLTypeInfo.BOOLEAN,  ResultsMetadataConstants.NULL_TYPES.NOT_NULL, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.FALSE, Boolean.FALSE, Boolean.TRUE, driverConnection);//$NON-NLS-1$ 
-        metadataList[8] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.SEARCHABLE, JDBCSQLTypeInfo.SHORT,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
-        metadataList[9] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.UNSIGNED_ATTRIBUTE, JDBCSQLTypeInfo.BOOLEAN,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
-        metadataList[10] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.FIXED_PREC_SCALE, JDBCSQLTypeInfo.BOOLEAN,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$
-        metadataList[11] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.AUTOINCREMENT, JDBCSQLTypeInfo.BOOLEAN,  ResultsMetadataConstants.NULL_TYPES.NOT_NULL, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.FALSE, Boolean.TRUE, Boolean.TRUE, driverConnection);//$NON-NLS-1$ 
-        metadataList[12] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.LOCAL_TYPE_NAME, JDBCSQLTypeInfo.STRING,  ResultsMetadataConstants.NULL_TYPES.NOT_NULL, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
-        metadataList[13] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.MINIMUM_SCALE, JDBCSQLTypeInfo.SHORT,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
-        metadataList[14] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.MAXIMUM_SCALE, JDBCSQLTypeInfo.SHORT,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
-        metadataList[15] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.SQL_DATA_TYPE, JDBCSQLTypeInfo.INTEGER,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
-        metadataList[16] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.SQL_DATETIME_SUB, JDBCSQLTypeInfo.INTEGER,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
-        metadataList[17] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.NUM_PREC_RADIX, JDBCSQLTypeInfo.INTEGER,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
+        metadataList[0] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.TYPE_NAME, DataTypeManager.DefaultDataTypes.STRING,  ResultsMetadataConstants.NULL_TYPES.NOT_NULL, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
+        metadataList[1] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.DATA_TYPE, DataTypeManager.DefaultDataTypes.INTEGER,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
+        metadataList[2] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.PRECISION, DataTypeManager.DefaultDataTypes.INTEGER,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
+        metadataList[3] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.LITERAL_PREFIX, DataTypeManager.DefaultDataTypes.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE,  ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
+        metadataList[4] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.LITERAL_SUFFIX, DataTypeManager.DefaultDataTypes.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE,  ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
+        metadataList[5] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.CREATE_PARAMS, DataTypeManager.DefaultDataTypes.STRING,  ResultsMetadataConstants.NULL_TYPES.NULLABLE,  ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
+        metadataList[6] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.NULLABLE, DataTypeManager.DefaultDataTypes.SHORT,  ResultsMetadataConstants.NULL_TYPES.NULLABLE,  ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
+        metadataList[7] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.CASE_SENSITIVE, DataTypeManager.DefaultDataTypes.BOOLEAN,  ResultsMetadataConstants.NULL_TYPES.NOT_NULL, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.FALSE, Boolean.FALSE, Boolean.TRUE, driverConnection);//$NON-NLS-1$ 
+        metadataList[8] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.SEARCHABLE, DataTypeManager.DefaultDataTypes.SHORT,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
+        metadataList[9] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.UNSIGNED_ATTRIBUTE, DataTypeManager.DefaultDataTypes.BOOLEAN,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
+        metadataList[10] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.FIXED_PREC_SCALE, DataTypeManager.DefaultDataTypes.BOOLEAN,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$
+        metadataList[11] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.AUTOINCREMENT, DataTypeManager.DefaultDataTypes.BOOLEAN,  ResultsMetadataConstants.NULL_TYPES.NOT_NULL, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.FALSE, Boolean.TRUE, Boolean.TRUE, driverConnection);//$NON-NLS-1$ 
+        metadataList[12] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.LOCAL_TYPE_NAME, DataTypeManager.DefaultDataTypes.STRING,  ResultsMetadataConstants.NULL_TYPES.NOT_NULL, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
+        metadataList[13] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.MINIMUM_SCALE, DataTypeManager.DefaultDataTypes.SHORT,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
+        metadataList[14] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.MAXIMUM_SCALE, DataTypeManager.DefaultDataTypes.SHORT,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
+        metadataList[15] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.SQL_DATA_TYPE, DataTypeManager.DefaultDataTypes.INTEGER,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
+        metadataList[16] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.SQL_DATETIME_SUB, DataTypeManager.DefaultDataTypes.INTEGER,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
+        metadataList[17] = StatementImpl.getColumnMetadata(CoreConstants.SYSTEM_MODEL + "." + DATA_TYPES, JDBCColumnNames.TYPE_INFO.NUM_PREC_RADIX, DataTypeManager.DefaultDataTypes.INTEGER,  ResultsMetadataConstants.NULL_TYPES.NULLABLE, ResultsMetadataConstants.SEARCH_TYPES.SEARCHABLE, Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, driverConnection);//$NON-NLS-1$ 
 
         ResultSetMetaData rmetadata = new ResultSetMetaDataImpl(new MetadataProvider(metadataList), null);
 
@@ -1595,7 +1598,7 @@
     }
 
     private Object[] createTypeInfoRow(String typeName, String prefix, String suffix, Boolean unsigned, Boolean fixedPrecScale, int radix){
-        return new Object[] {typeName, new Integer(JDBCSQLTypeInfo.getSQLType(typeName)), ResultsMetadataDefaults.getDefaultPrecision(typeName), prefix, suffix, null, new Short((short)DatabaseMetaData.typeNullable), Boolean.FALSE, new Short((short)DatabaseMetaData.typeSearchable), unsigned, fixedPrecScale, Boolean.FALSE, typeName, new Short((short)0), new Short((short)255), null, null, new Integer(radix)};
+        return new Object[] {typeName, new Integer(JDBCSQLTypeInfo.getSQLType(typeName)), JDBCSQLTypeInfo.getDefaultPrecision(typeName), prefix, suffix, null, new Short((short)DatabaseMetaData.typeNullable), Boolean.FALSE, new Short((short)DatabaseMetaData.typeSearchable), unsigned, fixedPrecScale, Boolean.FALSE, typeName, new Short((short)0), new Short((short)255), null, null, new Integer(radix)};
     }
     
     /**
@@ -1630,13 +1633,13 @@
                 JDBCColumnNames.UDTS.BASE_TYPE
         };
         String[] dataTypes = new String[] {
-                JDBCSQLTypeInfo.STRING,
-                JDBCSQLTypeInfo.STRING,
-                JDBCSQLTypeInfo.STRING,
-                JDBCSQLTypeInfo.STRING,
-                JDBCSQLTypeInfo.STRING, 
-                JDBCSQLTypeInfo.STRING,
-                JDBCSQLTypeInfo.SHORT                
+                DataTypeManager.DefaultDataTypes.STRING,
+                DataTypeManager.DefaultDataTypes.STRING,
+                DataTypeManager.DefaultDataTypes.STRING,
+                DataTypeManager.DefaultDataTypes.STRING,
+                DataTypeManager.DefaultDataTypes.STRING, 
+                DataTypeManager.DefaultDataTypes.STRING,
+                DataTypeManager.DefaultDataTypes.SHORT                
         };       
         return dummyStatement().createResultSet(Collections.EMPTY_LIST, columnNames, dataTypes);
     }
Index: client/src/main/java/org/teiid/client/ResultsMessage.java
===================================================================
--- client/src/main/java/org/teiid/client/ResultsMessage.java	(revision 3801)
+++ client/src/main/java/org/teiid/client/ResultsMessage.java	(working copy)
@@ -242,7 +242,7 @@
         dataTypes = ExternalizeUtil.readStringArray(in);
 
         // Row data
-        results = BatchSerializer.readBatch(in, dataTypes, (byte)0);
+        results = BatchSerializer.readBatch(in, dataTypes);
 
         // Plan Descriptions
         planDescription = (PlanNode)in.readObject();
@@ -274,7 +274,7 @@
         ExternalizeUtil.writeArray(out, dataTypes);
 
         // Results data
-        BatchSerializer.writeBatch(out, dataTypes, results, (byte)0);
+        BatchSerializer.writeBatch(out, dataTypes, results, clientSerializationVersion);
 
         // Plan descriptions
         out.writeObject(this.planDescription);
Index: client/src/test/java/org/teiid/jdbc/TestCallableStatement.java
===================================================================
--- client/src/test/java/org/teiid/jdbc/TestCallableStatement.java	(revision 3801)
+++ client/src/test/java/org/teiid/jdbc/TestCallableStatement.java	(working copy)
@@ -38,7 +38,7 @@
 import org.teiid.client.ResultsMessage;
 import org.teiid.client.metadata.ParameterInfo;
 import org.teiid.client.security.LogonResult;
-import org.teiid.core.types.JDBCSQLTypeInfo;
+import org.teiid.core.types.DataTypeManager;
 import org.teiid.net.ServerConnection;
 
 @SuppressWarnings("nls")
@@ -70,7 +70,7 @@
 		List<?>[] results = new List[] {Arrays.asList(null, null, null), Arrays.asList(null, 1, 2)};
 		resultsMsg.setResults(results);
 		resultsMsg.setColumnNames(new String[] { "IntNum", "Out1", "Out2" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		resultsMsg.setDataTypes(new String[] { JDBCSQLTypeInfo.INTEGER, JDBCSQLTypeInfo.INTEGER, JDBCSQLTypeInfo.INTEGER }); 
+		resultsMsg.setDataTypes(new String[] { DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataTypes.INTEGER }); 
 		resultsMsg.setFinalRow(results.length);
 		resultsMsg.setLastRow(results.length);
 		resultsMsg.setFirstRow(1);
Index: common-core/src/main/java/org/teiid/core/types/basic/ClobToStringTransform.java
===================================================================
--- common-core/src/main/java/org/teiid/core/types/basic/ClobToStringTransform.java	(revision 3801)
+++ common-core/src/main/java/org/teiid/core/types/basic/ClobToStringTransform.java	(working copy)
@@ -49,9 +49,9 @@
      */
     public Object transformDirect(Object value) throws TransformationException {
         ClobType source = (ClobType)value;
-        
+        BufferedReader reader = null;
         try {
-            BufferedReader reader = new BufferedReader (source.getCharacterStream());
+            reader = new BufferedReader (source.getCharacterStream());
             StringBuffer contents = new StringBuffer();
             
             int chr = reader.read();
@@ -59,14 +59,19 @@
                 contents.append((char)chr);
                 chr = reader.read();
             }
-            reader.close();
             return contents.toString();         
-            
         } catch (SQLException e) {
             throw new TransformationException(e, CorePlugin.Util.getString("failed_convert", new Object[] {getSourceType().getName(), getTargetType().getName()})); //$NON-NLS-1$            
         } catch(IOException e) {
             throw new TransformationException(e, CorePlugin.Util.getString("failed_convert", new Object[] {getSourceType().getName(), getTargetType().getName()})); //$NON-NLS-1$
-        } 
+        } finally {
+        	if (reader != null) {
+        		try {
+					reader.close();
+				} catch (IOException e) {
+				}
+        	}
+        }
     }
 
     /** 
Index: common-core/src/main/java/org/teiid/core/types/JDBCSQLTypeInfo.java
===================================================================
--- common-core/src/main/java/org/teiid/core/types/JDBCSQLTypeInfo.java	(revision 3801)
+++ common-core/src/main/java/org/teiid/core/types/JDBCSQLTypeInfo.java	(working copy)
@@ -25,10 +25,11 @@
 import java.sql.Blob;
 import java.sql.Clob;
 import java.sql.SQLXML;
-
 import java.sql.Types;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.Map;
+import java.util.Set;
 
 /**
  * <p> This is a helper class used to obtain SQL type information for java types.
@@ -37,99 +38,82 @@
  */
 
 public final class JDBCSQLTypeInfo {
-
-
+	
+	public static class TypeInfo {
+		String name;
+		int maxDisplaySize;
+		int defaultPrecision;
+		String javaClassName;
+		int[] jdbcTypes;
+		
+		public TypeInfo(int maxDisplaySize, int precision, String name,
+				String javaClassName, int[] jdbcTypes) {
+			super();
+			this.maxDisplaySize = maxDisplaySize;
+			this.defaultPrecision = precision;
+			this.name = name;
+			this.javaClassName = javaClassName;
+			this.jdbcTypes = jdbcTypes;
+		}
+		
+	}
+	
     // Prevent instantiation
     private JDBCSQLTypeInfo() {}
-    
-    // metamatrix types    
-    public static final String STRING = DataTypeManager.DefaultDataTypes.STRING;
-    public static final String BOOLEAN = DataTypeManager.DefaultDataTypes.BOOLEAN;
-    public static final String TIME = DataTypeManager.DefaultDataTypes.TIME;
-    public static final String DATE = DataTypeManager.DefaultDataTypes.DATE;
-    public static final String TIMESTAMP = DataTypeManager.DefaultDataTypes.TIMESTAMP;
-    public static final String INTEGER = DataTypeManager.DefaultDataTypes.INTEGER;
-    public static final String FLOAT = DataTypeManager.DefaultDataTypes.FLOAT;
-    public static final String DOUBLE = DataTypeManager.DefaultDataTypes.DOUBLE;
-    public static final String BIGDECIMAL = DataTypeManager.DefaultDataTypes.BIG_DECIMAL;
-    public static final String BIGINTEGER = DataTypeManager.DefaultDataTypes.BIG_INTEGER;
-    public static final String BYTE = DataTypeManager.DefaultDataTypes.BYTE;
-    public static final String SHORT = DataTypeManager.DefaultDataTypes.SHORT;
-    public static final String LONG = DataTypeManager.DefaultDataTypes.LONG;
-    public static final String CHAR = DataTypeManager.DefaultDataTypes.CHAR;
-    public static final String OBJECT = DataTypeManager.DefaultDataTypes.OBJECT;
-    public static final String CLOB = DataTypeManager.DefaultDataTypes.CLOB;
-    public static final String BLOB = DataTypeManager.DefaultDataTypes.BLOB;
-    public static final String XML = DataTypeManager.DefaultDataTypes.XML;
-    public static final String NULL = DataTypeManager.DefaultDataTypes.NULL;
-    
-    //java class names
-    public static final String STRING_CLASS = DataTypeManager.DefaultDataClasses.STRING.getName();
-    public static final String BOOLEAN_CLASS = DataTypeManager.DefaultDataClasses.BOOLEAN.getName();
-    public static final String TIME_CLASS = DataTypeManager.DefaultDataClasses.TIME.getName();
-    public static final String DATE_CLASS = DataTypeManager.DefaultDataClasses.DATE.getName();
-    public static final String TIMESTAMP_CLASS = DataTypeManager.DefaultDataClasses.TIMESTAMP.getName();
-    public static final String INTEGER_CLASS = DataTypeManager.DefaultDataClasses.INTEGER.getName();
-    public static final String FLOAT_CLASS = DataTypeManager.DefaultDataClasses.FLOAT.getName();
-    public static final String DOUBLE_CLASS = DataTypeManager.DefaultDataClasses.DOUBLE.getName();
-    public static final String BIGDECIMAL_CLASS = DataTypeManager.DefaultDataClasses.BIG_DECIMAL.getName();
-    public static final String BYTE_CLASS = DataTypeManager.DefaultDataClasses.BYTE.getName();
-    public static final String SHORT_CLASS = DataTypeManager.DefaultDataClasses.SHORT.getName();
-    public static final String LONG_CLASS = DataTypeManager.DefaultDataClasses.LONG.getName();
-    public static final String CHAR_CLASS = DataTypeManager.DefaultDataClasses.CHAR.getName();
-    public static final String BIGINTEGER_CLASS = DataTypeManager.DefaultDataClasses.BIG_INTEGER.getName();
-    public static final String OBJECT_CLASS = DataTypeManager.DefaultDataClasses.OBJECT.getName();
-    public static final String CLOB_CLASS = Clob.class.getName();
-    public static final String BLOB_CLASS = Blob.class.getName();
-    public static final String XML_CLASS = SQLXML.class.getName();
-    
-    private static Map<String, Integer> NAME_TO_TYPE_MAP = new HashMap<String, Integer>();
-    private static Map<Integer, String> TYPE_TO_NAME_MAP = new HashMap<Integer, String>();
-    private static Map<String, String> NAME_TO_CLASSNAME = new HashMap<String, String>();
-    private static Map<String, String> CLASSNAME_TO_NAME = new HashMap<String, String>();
-    
+
+    public static final Integer DEFAULT_RADIX = 10;
+    public static final Integer DEFAULT_SCALE = 0;
+
+    // XML column constants
+    public final static Integer XML_COLUMN_LENGTH = Integer.MAX_VALUE;
+
+    private static Map<String, TypeInfo> NAME_TO_TYPEINFO = new LinkedHashMap<String, TypeInfo>();
+    private static Map<Integer, TypeInfo> TYPE_TO_TYPEINFO = new HashMap<Integer, TypeInfo>();
+    private static Map<String, TypeInfo> CLASSNAME_TO_TYPEINFO = new HashMap<String, TypeInfo>();
+
     static {
-        addTypeMapping(STRING, STRING_CLASS, Types.VARCHAR, Types.CHAR, Types.NVARCHAR, Types.NCHAR);
-        addTypeMapping(CHAR, CHAR_CLASS, Types.CHAR, false);
-        addTypeMapping(BOOLEAN, BOOLEAN_CLASS, Types.BIT, Types.BOOLEAN);
-        addTypeMapping(TIME, TIME_CLASS, Types.TIME);
-        addTypeMapping(DATE, DATE_CLASS, Types.DATE);
-        addTypeMapping(TIMESTAMP, TIMESTAMP_CLASS, Types.TIMESTAMP);
-        addTypeMapping(INTEGER, INTEGER_CLASS, Types.INTEGER);
-        addTypeMapping(FLOAT, FLOAT_CLASS, Types.REAL);
-        addTypeMapping(DOUBLE, DOUBLE_CLASS, Types.DOUBLE, Types.FLOAT);
-        addTypeMapping(BIGDECIMAL, BIGDECIMAL_CLASS, Types.NUMERIC, Types.DECIMAL);
-        addTypeMapping(BIGINTEGER, BIGINTEGER_CLASS, Types.NUMERIC, false);
-        addTypeMapping(BYTE, BYTE_CLASS, Types.TINYINT);
-        addTypeMapping(SHORT, SHORT_CLASS, Types.SMALLINT);
-        addTypeMapping(LONG, LONG_CLASS, Types.BIGINT);
-        addTypeMapping(OBJECT, OBJECT_CLASS, Types.JAVA_OBJECT);
-        addTypeMapping(CLOB, CLOB_CLASS, Types.CLOB, Types.LONGVARCHAR, Types.LONGNVARCHAR, Types.NCLOB);
-        addTypeMapping(BLOB, BLOB_CLASS, Types.BLOB, Types.BINARY, Types.VARBINARY, Types.LONGVARBINARY);
-        
-        addTypeMapping(NULL, null, Types.NULL);
-        
-        addTypeMapping(XML, XML_CLASS, Types.SQLXML);
+    	//note the order in which these are added matters.  if there are multiple sql type mappings (e.g. biginteger and bigdecimal to numeric), the latter will be the primary
+    	addType(DataTypeManager.DefaultDataTypes.BIG_INTEGER, 20, 19, DataTypeManager.DefaultDataClasses.BIG_INTEGER.getName(), Types.NUMERIC);
+    	addType(new String[] {DataTypeManager.DefaultDataTypes.BIG_DECIMAL, "decimal"}, 22, 20, DataTypeManager.DefaultDataClasses.BIG_DECIMAL.getName(), Types.NUMERIC, Types.DECIMAL); //$NON-NLS-1$
+    	addType(DataTypeManager.DefaultDataTypes.BLOB, Integer.MAX_VALUE, Integer.MAX_VALUE, Blob.class.getName(), Types.BLOB, Types.LONGVARBINARY);
+    	addType(DataTypeManager.DefaultDataTypes.BOOLEAN, 5, 1, DataTypeManager.DefaultDataClasses.BOOLEAN.getName(), Types.BIT, Types.BOOLEAN);
+    	addType(new String[] {DataTypeManager.DefaultDataTypes.BYTE, "tinyint"}, 4, 3, DataTypeManager.DefaultDataClasses.BYTE.getName(), Types.TINYINT); //$NON-NLS-1$
+    	addType(DataTypeManager.DefaultDataTypes.CHAR, 1, 1, DataTypeManager.DefaultDataClasses.CHAR.getName(), Types.CHAR);
+    	addType(DataTypeManager.DefaultDataTypes.CLOB, Integer.MAX_VALUE, Integer.MAX_VALUE, Clob.class.getName(), Types.CLOB, Types.NCLOB, Types.LONGNVARCHAR, Types.LONGVARCHAR);
+    	addType(DataTypeManager.DefaultDataTypes.DATE, 10, 10, DataTypeManager.DefaultDataClasses.DATE.getName(), Types.DATE);
+    	addType(DataTypeManager.DefaultDataTypes.DOUBLE, 22, 20, DataTypeManager.DefaultDataClasses.DOUBLE.getName(), Types.DOUBLE, Types.FLOAT);
+    	addType(new String[] {DataTypeManager.DefaultDataTypes.FLOAT, "real"}, 22, 20, DataTypeManager.DefaultDataClasses.FLOAT.getName(), Types.REAL); //$NON-NLS-1$
+    	addType(DataTypeManager.DefaultDataTypes.INTEGER, 11, 10, DataTypeManager.DefaultDataClasses.INTEGER.getName(), Types.INTEGER);
+    	addType(new String[] {DataTypeManager.DefaultDataTypes.LONG, "bigint"}, 20, 19, DataTypeManager.DefaultDataClasses.LONG.getName(), Types.BIGINT); //$NON-NLS-1$
+    	addType(DataTypeManager.DefaultDataTypes.OBJECT, Integer.MAX_VALUE, Integer.MAX_VALUE, DataTypeManager.DefaultDataClasses.OBJECT.getName(), Types.JAVA_OBJECT);
+    	addType(new String[] {DataTypeManager.DefaultDataTypes.SHORT, "smallint"}, 6, 5, DataTypeManager.DefaultDataClasses.SHORT.getName(), Types.SMALLINT); //$NON-NLS-1$
+    	addType(new String[] {DataTypeManager.DefaultDataTypes.STRING, "varchar"}, DataTypeManager.MAX_STRING_LENGTH, DataTypeManager.MAX_STRING_LENGTH, DataTypeManager.DefaultDataClasses.STRING.getName(), Types.VARCHAR, Types.NVARCHAR, Types.CHAR, Types.NCHAR); //$NON-NLS-1$
+    	addType(DataTypeManager.DefaultDataTypes.TIME, 8, 8, DataTypeManager.DefaultDataClasses.TIME.getName(), Types.TIME);
+    	addType(DataTypeManager.DefaultDataTypes.TIMESTAMP, 29, 29, DataTypeManager.DefaultDataClasses.TIMESTAMP.getName(), Types.TIMESTAMP);
+    	addType(DataTypeManager.DefaultDataTypes.XML, Integer.MAX_VALUE, Integer.MAX_VALUE, SQLXML.class.getName(), Types.SQLXML);
+    	addType(DataTypeManager.DefaultDataTypes.NULL, 4, 1, null, Types.NULL);
+    	addType(DataTypeManager.DefaultDataTypes.VARBINARY, DataTypeManager.MAX_LOB_MEMORY_BYTES, DataTypeManager.MAX_LOB_MEMORY_BYTES, byte[].class.getName(), Types.VARBINARY, Types.BINARY);
     }
 
-	private static void addTypeMapping(String typeName, String javaClass, int sqlType, int ... secondaryTypes) {
-		addTypeMapping(typeName, javaClass, sqlType, true);
-		for (int type : secondaryTypes) {
-			TYPE_TO_NAME_MAP.put(type, typeName);
+	private static TypeInfo addType(String typeName, int maxDisplaySize, int precision, String javaClassName, int... sqlTypes) {
+		TypeInfo ti = new TypeInfo(maxDisplaySize, precision, typeName, javaClassName, sqlTypes);
+		NAME_TO_TYPEINFO.put(typeName, ti);
+		if (javaClassName != null) {
+			CLASSNAME_TO_TYPEINFO.put(javaClassName, ti);
 		}
-	}
-
-	private static void addTypeMapping(String typeName, String javaClass, int sqlType, boolean preferedType) {
-		NAME_TO_TYPE_MAP.put(typeName, sqlType);
-		if (preferedType) {
-			TYPE_TO_NAME_MAP.put(sqlType, typeName);
+		for (int i : sqlTypes) {
+			TYPE_TO_TYPEINFO.put(i, ti);
 		}
-		if (javaClass != null) {
-			NAME_TO_CLASSNAME.put(typeName, javaClass);
-			CLASSNAME_TO_NAME.put(javaClass, typeName);
+		return ti;
+	}
+	
+	private static void addType(String[] typeNames, int maxDisplaySize, int precision, String javaClassName, int... sqlTypes) {
+		TypeInfo ti = addType(typeNames[0], maxDisplaySize, precision, javaClassName, sqlTypes);
+		for (int i = 1; i < typeNames.length; i++) {
+			NAME_TO_TYPEINFO.put(typeNames[i], ti);
 		}
 	}
-    
+
     /**
      * This method is used to obtain a short indicating JDBC SQL type for any object.
      * The short values that give the type info are from java.sql.Types.
@@ -142,13 +126,13 @@
             return Types.NULL;
         }
         
-        Integer sqlType = NAME_TO_TYPE_MAP.get(typeName);
+        TypeInfo sqlType = NAME_TO_TYPEINFO.get(typeName);
         
         if (sqlType == null) {
             return Types.JAVA_OBJECT;
         }
         
-        return sqlType.intValue();
+        return sqlType.jdbcTypes[0];
     }    
 
     /**
@@ -163,13 +147,13 @@
             return Types.NULL;
         }
         
-        String name = CLASSNAME_TO_NAME.get(className);
+        TypeInfo sqlType = CLASSNAME_TO_TYPEINFO.get(className);
         
-        if (name == null) {
+        if (sqlType == null) {
             return Types.JAVA_OBJECT;
         }
         
-        return getSQLType(name);
+        return sqlType.jdbcTypes[0];
     } 
     
     /**
@@ -199,46 +183,51 @@
      * @return A String representing the java class name for the given SQL Type.
      */
     public static final String getJavaClassName(int jdbcSQLType) {
-    	String className = NAME_TO_CLASSNAME.get(getTypeName(jdbcSQLType));
+    	TypeInfo typeInfo = TYPE_TO_TYPEINFO.get(jdbcSQLType);
     	
-    	if (className == null) {
-    		return OBJECT_CLASS;
+    	if (typeInfo == null) {
+    		return DataTypeManager.DefaultDataClasses.OBJECT.getName();
     	}
     	
-    	return className;
+    	return typeInfo.javaClassName;
     }
     
     public static final String getTypeName(int sqlType) {
-    	String name = TYPE_TO_NAME_MAP.get(sqlType);
+    	TypeInfo typeInfo = TYPE_TO_TYPEINFO.get(sqlType);
     	
-    	if (name == null) {
-    		return OBJECT;
+    	if (typeInfo == null) {
+    		return DataTypeManager.DefaultDataTypes.OBJECT;
     	}
     	
-    	return name;
+    	return typeInfo.name;
     }
 
-    public static String[] getMMTypeNames() {
-        return new String[] {
-            STRING,
-            BOOLEAN,
-            TIME,
-            DATE,
-            TIMESTAMP,
-            INTEGER,
-            FLOAT,
-            DOUBLE,
-            BIGDECIMAL,
-            BIGINTEGER,
-            BYTE,
-            SHORT,
-            LONG,
-            CHAR,
-            OBJECT,
-            CLOB,
-            BLOB,
-            XML
-        };
+    public static Set<String> getMMTypeNames() {
+    	return NAME_TO_TYPEINFO.keySet();
     }
 
+	public static Integer getMaxDisplaySize(Class<?> dataTypeClass) {
+	    return getMaxDisplaySize(DataTypeManager.getDataTypeName(dataTypeClass));
+	}
+
+	public static Integer getMaxDisplaySize(String typeName) {
+		TypeInfo ti = NAME_TO_TYPEINFO.get(typeName);
+		if (ti == null) {
+			return null;
+		}
+	    return ti.maxDisplaySize;
+	}
+
+	public static Integer getDefaultPrecision(Class<?> dataTypeClass) {
+	    return getDefaultPrecision(DataTypeManager.getDataTypeName(dataTypeClass));
+	}
+
+	public static Integer getDefaultPrecision(String typeName) {
+		TypeInfo ti = NAME_TO_TYPEINFO.get(typeName);
+		if (ti == null) {
+			return null;
+		}
+	    return ti.defaultPrecision;
+	}
+
 }
Index: runtime/src/main/java/org/teiid/deployers/VDBRepository.java
===================================================================
--- runtime/src/main/java/org/teiid/deployers/VDBRepository.java	(revision 3801)
+++ runtime/src/main/java/org/teiid/deployers/VDBRepository.java	(working copy)
@@ -55,6 +55,7 @@
 	private List<VDBLifeCycleListener> listeners = new CopyOnWriteArrayList<VDBLifeCycleListener>();
 	private SystemFunctionManager systemFunctionManager;
 	private MetadataRepository metadataRepository;
+	private Map<String, Datatype> datatypeMap = new HashMap<String, Datatype>();
 	
 	public MetadataRepository getMetadataRepository() {
 		return metadataRepository;
@@ -224,6 +225,15 @@
 	
 	public void setSystemStore(MetadataStore store) {
 		this.systemStore = store;
+		Collection<Datatype> datatypes = this.systemStore.getDatatypes();
+		for (Class<?> typeClass : DataTypeManager.getAllDataTypeClasses()) {
+			for (Datatype datatypeRecordImpl : datatypes) {
+				if (datatypeRecordImpl.getJavaClassName().equals(typeClass.getName())) {
+					datatypeMap.put(DataTypeManager.getDataTypeName(typeClass), datatypeRecordImpl);
+					break;
+				}
+			}
+		}
 	}
 	
 	public void setMetadataRepository(MetadataRepository metadataRepository) {
@@ -265,16 +275,6 @@
 	}	
 	
 	public Map<String, Datatype> getBuiltinDatatypes() {
-		Collection<Datatype> datatypes = this.systemStore.getDatatypes();
-		Map<String, Datatype> datatypeMap = new HashMap<String, Datatype>();
-		for (Class<?> typeClass : DataTypeManager.getAllDataTypeClasses()) {
-			for (Datatype datatypeRecordImpl : datatypes) {
-				if (datatypeRecordImpl.getJavaClassName().equals(typeClass.getName())) {
-					datatypeMap.put(DataTypeManager.getDataTypeName(typeClass), datatypeRecordImpl);
-					break;
-				}
-			}
-		}
 		return datatypeMap;
 	}
 	
Index: client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java
===================================================================
--- client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java	(revision 3801)
+++ client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java	(working copy)
@@ -41,6 +41,7 @@
 import java.sql.Time;
 import java.sql.Timestamp;
 
+import org.teiid.core.types.BinaryType;
 import org.teiid.core.types.DataTypeManager;
 import org.teiid.core.types.TransformationException;
 import org.teiid.core.types.DataTypeManager.DefaultDataClasses;
@@ -127,6 +128,8 @@
             return blob.getBytes(1, (int)length);
         } else if (value instanceof String) {
         	return ((String)value).getBytes();
+        } else if (value instanceof BinaryType) {
+        	return ((BinaryType)value).getBytesDirect();
         }
         throw new TeiidSQLException(JDBCPlugin.Util.getString("DataTypeTransformer.cannot_get_bytes")); //$NON-NLS-1$
     }
Index: documentation/reference/src/main/docbook/en-US/content/datatypes.xml
===================================================================
--- documentation/reference/src/main/docbook/en-US/content/datatypes.xml	(revision 3801)
+++ documentation/reference/src/main/docbook/en-US/content/datatypes.xml	(working copy)
@@ -144,6 +144,15 @@
             <entry>VARCHAR</entry>
           </row>
           <row>
+            <entry>varbinary</entry>
+            <entry>binary type representing a byte array</entry>
+            <entry>
+              org.teiid.core.types.BinaryType
+            </entry>
+            <entry>VARBINARY</entry>
+            <entry>VARCHAR</entry>
+          </row>
+          <row>
             <entry>blob</entry>
             <entry>binary large object, representing a stream of
               bytes</entry>
Index: client/src/test/java/org/teiid/client/TestBatchSerializer.java
===================================================================
--- client/src/test/java/org/teiid/client/TestBatchSerializer.java	(revision 3801)
+++ client/src/test/java/org/teiid/client/TestBatchSerializer.java	(working copy)
@@ -34,6 +34,7 @@
 
 import junit.framework.TestCase;
 
+import org.teiid.core.types.BinaryType;
 import org.teiid.core.types.DataTypeManager;
 import org.teiid.core.util.TimestampWithTimezone;
 
@@ -78,6 +79,7 @@
                                                       DataTypeManager.DefaultDataTypes.TIME,
                                                       DataTypeManager.DefaultDataTypes.TIMESTAMP,
                                                       DataTypeManager.DefaultDataTypes.OBJECT,
+                                                      DataTypeManager.DefaultDataTypes.VARBINARY,
                                                      };
     private static String sampleString(int length) {
         char[] chars = new char[length];
@@ -92,7 +94,7 @@
         
         for (int i = 0; i < rows; i++) {
         	java.util.Date d = new java.util.Date();
-            int mod = i%14;
+            int mod = i%16;
             Object[] data = { (mod == 0) ? null : new BigDecimal("" + i), //$NON-NLS-1$
                               (mod == 1) ? null : new BigInteger(Integer.toString(i)),
                               (mod == 2) ? null : ((i%2 == 0) ? Boolean.FALSE: Boolean.TRUE),
@@ -108,6 +110,7 @@
                               (mod == 12) ? null : TimestampWithTimezone.createTime(d),
                               (mod == 13) ? null : TimestampWithTimezone.createTimestamp(d),
                               (mod == 14) ? null : TimestampWithTimezone.createTimestamp(d),
+                    		  (mod == 15) ? null : new BinaryType(new byte[] {(byte)i}),
                             };
             batch[i] = Arrays.asList(data);
         }
Index: client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java
===================================================================
--- client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java	(revision 3801)
+++ client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java	(working copy)
@@ -37,8 +37,6 @@
 import java.util.TimeZone;
 import java.util.TreeMap;
 
-import javax.sql.rowset.serial.SerialBlob;
-
 import org.teiid.client.RequestMessage;
 import org.teiid.client.RequestMessage.ResultsMode;
 import org.teiid.client.RequestMessage.StatementType;
@@ -48,6 +46,7 @@
 import org.teiid.core.TeiidProcessingException;
 import org.teiid.core.types.BlobImpl;
 import org.teiid.core.types.ClobImpl;
+import org.teiid.core.types.DataTypeManager;
 import org.teiid.core.types.InputStreamFactory;
 import org.teiid.core.types.JDBCSQLTypeInfo;
 import org.teiid.core.types.Streamable;
@@ -298,7 +297,7 @@
     }
 
     public void setBytes(int parameterIndex, byte bytes[]) throws SQLException {
-    	setObject(parameterIndex, new SerialBlob(bytes));
+    	setObject(parameterIndex, bytes);
     }
 
     public void setCharacterStream (int parameterIndex, java.io.Reader reader, int length) throws SQLException {
@@ -379,7 +378,7 @@
     }
 
     void setObject(Object parameterIndex, Object value, int targetJdbcType) throws SQLException {
-        Object targetObject = null;
+        Object targetObject = value;
 
         if(value == null) {
             setObject(parameterIndex, null);
@@ -387,45 +386,61 @@
         }
 
         // get the java class name for the given JDBC type
-        String javaClassName = JDBCSQLTypeInfo.getJavaClassName(targetJdbcType);
+        String typeName = JDBCSQLTypeInfo.getTypeName(targetJdbcType);
+        int typeCode = DataTypeManager.getTypeCode(DataTypeManager.getDataTypeClass(typeName));
         // transform the value to the target datatype
-        if (targetJdbcType == Types.JAVA_OBJECT) {
-        	targetObject = value;
-        } else if(javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.STRING_CLASS)) {
-            targetObject = DataTypeTransformer.getString(value);
-        } else if(javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.CHAR_CLASS)) {
-            targetObject = DataTypeTransformer.getCharacter(value);
-        } else if(javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.INTEGER_CLASS)) {
-            targetObject = DataTypeTransformer.getInteger(value);
-        } else if(javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.BYTE_CLASS)) {
-            targetObject = DataTypeTransformer.getByte(value);
-        } else if(javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.SHORT_CLASS)) {
-            targetObject = DataTypeTransformer.getShort(value);
-        } else if(javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.LONG_CLASS)) {
-            targetObject = DataTypeTransformer.getLong(value);
-        } else if(javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.FLOAT_CLASS)) {
-            targetObject = DataTypeTransformer.getFloat(value);
-        } else if(javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.DOUBLE_CLASS)) {
-            targetObject = DataTypeTransformer.getDouble(value);
-        } else if(javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.BOOLEAN_CLASS)) {
-            targetObject = DataTypeTransformer.getBoolean(value);
-        } else if(javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.BIGDECIMAL_CLASS)) {
-            targetObject = DataTypeTransformer.getBigDecimal(value);
-        } else if(javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.TIMESTAMP_CLASS)) {
-            targetObject = DataTypeTransformer.getTimestamp(value);
-        } else if(javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.DATE_CLASS)) {
-            targetObject = DataTypeTransformer.getDate(value);
-        } else if(javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.TIME_CLASS)) {
-            targetObject = DataTypeTransformer.getTime(value);
-        } else if (javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.BLOB_CLASS)) {
-            targetObject = DataTypeTransformer.getBlob(value);
-        } else if (javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.CLOB_CLASS)) {
-            targetObject = DataTypeTransformer.getClob(value);
-        } else if (javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.XML_CLASS)) {
+        switch (typeCode) {
+        case DataTypeManager.DefaultTypeCodes.STRING:
+        	targetObject = DataTypeTransformer.getString(value);
+        	break;
+        case DataTypeManager.DefaultTypeCodes.CHAR:
+        	targetObject = DataTypeTransformer.getCharacter(value);
+        	break;
+        case DataTypeManager.DefaultTypeCodes.INTEGER:
+        	targetObject = DataTypeTransformer.getInteger(value);
+        	break;
+        case DataTypeManager.DefaultTypeCodes.BYTE:
+        	targetObject = DataTypeTransformer.getByte(value);
+        	break;
+        case DataTypeManager.DefaultTypeCodes.SHORT:
+        	targetObject = DataTypeTransformer.getShort(value);
+        	break;
+        case DataTypeManager.DefaultTypeCodes.LONG:
+        	targetObject = DataTypeTransformer.getLong(value);
+        	break;
+        case DataTypeManager.DefaultTypeCodes.FLOAT:
+        	targetObject = DataTypeTransformer.getFloat(value);
+        	break;
+        case DataTypeManager.DefaultTypeCodes.DOUBLE:
+        	targetObject = DataTypeTransformer.getDouble(value);
+        	break;
+        case DataTypeManager.DefaultTypeCodes.BOOLEAN:
+        	targetObject = DataTypeTransformer.getBoolean(value);
+        	break;
+        case DataTypeManager.DefaultTypeCodes.BIGDECIMAL:
+        	targetObject = DataTypeTransformer.getBigDecimal(value);
+        	break;
+        case DataTypeManager.DefaultTypeCodes.TIMESTAMP:
+        	targetObject = DataTypeTransformer.getTimestamp(value);
+        	break;
+        case DataTypeManager.DefaultTypeCodes.DATE:
+        	targetObject = DataTypeTransformer.getDate(value);
+        	break;
+        case DataTypeManager.DefaultTypeCodes.TIME:
+        	targetObject = DataTypeTransformer.getTime(value);
+        	break;
+        case DataTypeManager.DefaultTypeCodes.BLOB:
+        	targetObject = DataTypeTransformer.getBlob(value);
+        	break;
+        case DataTypeManager.DefaultTypeCodes.CLOB:
+        	targetObject = DataTypeTransformer.getClob(value);
+        	break;
+        case DataTypeManager.DefaultTypeCodes.XML:
         	targetObject = DataTypeTransformer.getSQLXML(value);
-        } else {
-            String msg = JDBCPlugin.Util.getString("MMPreparedStatement.Err_transform_obj"); //$NON-NLS-1$
-            throw new TeiidSQLException(msg);
+        	break;
+        case DataTypeManager.DefaultTypeCodes.VARBINARY:
+        	targetObject = DataTypeTransformer.getBytes(value);
+        	break;
         }
 
         setObject(parameterIndex, targetObject);
Index: common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java
===================================================================
--- common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java	(revision 3801)
+++ common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java	(working copy)
@@ -159,15 +159,13 @@
     
     @Test public void testJDBCSQLTypeInfo() {
         
-        String[] types = JDBCSQLTypeInfo.getMMTypeNames();
+        Set<String> types = JDBCSQLTypeInfo.getMMTypeNames();
         
-        for (int i = 0; i < types.length; i++) {
-            String type = types[i];
-            
+        for (String type : types) {
             assertEquals("Didn't get match for "+ type, JDBCSQLTypeInfo.getSQLType(type), JDBCSQLTypeInfo.getSQLTypeFromRuntimeType(DataTypeManager.getDataTypeClass(type))); //$NON-NLS-1$
             
             //the classnames will not match the runtime types for xml, clob, blob
-            if (!type.equalsIgnoreCase(DataTypeManager.DefaultDataTypes.XML) && !type.equalsIgnoreCase(DataTypeManager.DefaultDataTypes.CLOB) && !type.equalsIgnoreCase(DataTypeManager.DefaultDataTypes.BLOB)) {
+            if (!type.equalsIgnoreCase(DataTypeManager.DefaultDataTypes.NULL) && !type.equalsIgnoreCase(DataTypeManager.DefaultDataTypes.VARBINARY) && !type.equalsIgnoreCase(DataTypeManager.DefaultDataTypes.XML) && !type.equalsIgnoreCase(DataTypeManager.DefaultDataTypes.CLOB) && !type.equalsIgnoreCase(DataTypeManager.DefaultDataTypes.BLOB)) {
                 assertEquals("Didn't get match for "+ type, JDBCSQLTypeInfo.getSQLType(type), JDBCSQLTypeInfo.getSQLTypeFromClass(DataTypeManager.getDataTypeClass(type).getName())); //$NON-NLS-1$
             }
         }
Index: client/src/test/java/org/teiid/jdbc/TestAllResultsImpl.java
===================================================================
--- client/src/test/java/org/teiid/jdbc/TestAllResultsImpl.java	(revision 3801)
+++ client/src/test/java/org/teiid/jdbc/TestAllResultsImpl.java	(working copy)
@@ -46,7 +46,7 @@
 import org.teiid.client.ResultsMessage;
 import org.teiid.client.util.ResultsFuture;
 import org.teiid.core.TeiidProcessingException;
-import org.teiid.core.types.JDBCSQLTypeInfo;
+import org.teiid.core.types.DataTypeManager;
 import org.teiid.core.util.TimestampWithTimezone;
 import org.teiid.query.unittest.TimestampUtil;
 
@@ -696,7 +696,7 @@
 	}
     
     @Test(expected=TeiidSQLException.class) public void testResultsMessageException() throws Exception {
-        ResultsMessage resultsMsg = exampleMessage(exampleResults1(1), new String[] { "IntNum" }, new String[] { JDBCSQLTypeInfo.INTEGER }); //$NON-NLS-1$
+        ResultsMessage resultsMsg = exampleMessage(exampleResults1(1), new String[] { "IntNum" }, new String[] { DataTypeManager.DefaultDataTypes.INTEGER }); //$NON-NLS-1$
         resultsMsg.setFinalRow(-1);
         ResultsMessage next = new ResultsMessage();
         next.setException(new Throwable());
@@ -769,8 +769,8 @@
 
 	private String[] dataTypes() {
 		String[] types = new String[2];
-		types[0] = JDBCSQLTypeInfo.INTEGER;
-		types[1] = JDBCSQLTypeInfo.STRING;
+		types[0] = DataTypeManager.DefaultDataTypes.INTEGER;
+		types[1] = DataTypeManager.DefaultDataTypes.STRING;
 		return types;
 	}
 
@@ -791,7 +791,7 @@
 
 	/** without metadata info. */
 	private ResultsMessage exampleResultsMsg1() {
-		return exampleMessage(exampleResults1(5), new String[] { "IntNum" }, new String[] { JDBCSQLTypeInfo.INTEGER }); //$NON-NLS-1$
+		return exampleMessage(exampleResults1(5), new String[] { "IntNum" }, new String[] { DataTypeManager.DefaultDataTypes.INTEGER }); //$NON-NLS-1$
 	}
 	
 	private ResultsMessage exampleMessage(List<Object>[] results, String[] columnNames, String[] datatypes) {
@@ -809,7 +809,7 @@
 
 	/** without metadata info. */
 	private ResultsMessage exampleResultsMsg2() {
-		return exampleMessage(exampleResults2(), new String[] { "IntNum", "StringNum" }, new String[] { JDBCSQLTypeInfo.INTEGER, JDBCSQLTypeInfo.STRING }); //$NON-NLS-1$ //$NON-NLS-2$
+		return exampleMessage(exampleResults2(), new String[] { "IntNum", "StringNum" }, new String[] { DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataTypes.STRING }); //$NON-NLS-1$ //$NON-NLS-2$
 	}
 
 	/** with limited metadata info. */
@@ -828,7 +828,7 @@
 
 	/** no rows. */
 	private ResultsMessage exampleResultsMsg3() {
-		return exampleMessage(new List[0], new String[] { "IntNum", "StringNum" }, new String[] { JDBCSQLTypeInfo.INTEGER, JDBCSQLTypeInfo.STRING }); //$NON-NLS-1$ //$NON-NLS-2$
+		return exampleMessage(new List[0], new String[] { "IntNum", "StringNum" }, new String[] { DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataTypes.STRING }); //$NON-NLS-1$ //$NON-NLS-2$
 	}
 	
 	private static ResultsMessage exampleResultsMsg4(int begin, int length, boolean lastBatch) {
@@ -838,7 +838,7 @@
 		List[] results = exampleResults1(length, begin);
 		resultsMsg.setResults(results);
 		resultsMsg.setColumnNames(new String[] { "IntKey" }); //$NON-NLS-1$
-		resultsMsg.setDataTypes(new String[] { JDBCSQLTypeInfo.INTEGER }); 
+		resultsMsg.setDataTypes(new String[] { DataTypeManager.DefaultDataTypes.INTEGER }); 
 		resultsMsg.setFirstRow(begin);
 		if (lastBatch) {
 			resultsMsg.setFinalRow(begin + results.length - 1);
@@ -865,7 +865,7 @@
 		ResultsMessage resultsMsg = new ResultsMessage();
 		resultsMsg.setResults(new List[] {Arrays.asList(new Timestamp(0))});
 		resultsMsg.setColumnNames(new String[] { "TS" }); //$NON-NLS-1$
-		resultsMsg.setDataTypes(new String[] { JDBCSQLTypeInfo.TIMESTAMP }); 
+		resultsMsg.setDataTypes(new String[] { DataTypeManager.DefaultDataTypes.TIMESTAMP }); 
 		resultsMsg.setFirstRow(1);
 		resultsMsg.setFinalRow(1);
 		resultsMsg.setLastRow(1);
@@ -882,7 +882,7 @@
 	
 	@Test public void testWasNull() throws SQLException{
 		ResultsMessage message = exampleMessage(new List[] { Arrays.asList((String)null), Arrays.asList("1") }, new String[] { "string" }, //$NON-NLS-1$
-				new String[] { JDBCSQLTypeInfo.STRING });
+				new String[] { DataTypeManager.DefaultDataTypes.STRING });
 		ResultSetImpl rs = new ResultSetImpl(message, statement);
 		assertTrue(rs.next());
 		assertEquals(Boolean.FALSE.booleanValue(), rs.getBoolean(1));
@@ -909,7 +909,7 @@
 		TimeZone.setDefault(TimeZone.getTimeZone("GMT-05:00")); //$NON-NLS-1$
 		ResultsMessage message = exampleMessage(new List[] { Arrays.asList(1, TimestampUtil.createTime(0, 0, 0), TimestampUtil.createDate(1, 1, 1), TimestampUtil.createTimestamp(1, 1, 1, 1, 1, 1, 1), "<root/>") }, //$NON-NLS-1$ 
 				new String[] { "int", "time", "date", "timestamp", "sqlxml" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ 
-				new String[] { JDBCSQLTypeInfo.INTEGER, JDBCSQLTypeInfo.TIME, JDBCSQLTypeInfo.DATE, JDBCSQLTypeInfo.TIMESTAMP, JDBCSQLTypeInfo.STRING });
+				new String[] { DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataTypes.TIME, DataTypeManager.DefaultDataTypes.DATE, DataTypeManager.DefaultDataTypes.TIMESTAMP, DataTypeManager.DefaultDataTypes.STRING });
 		TimestampWithTimezone.resetCalendar(TimeZone.getTimeZone("GMT-06:00")); //$NON-NLS-1$
 		ResultSetImpl rs = new ResultSetImpl(message, statement);
 		assertTrue(rs.next());
Index: client/src/main/java/org/teiid/jdbc/StatementImpl.java
===================================================================
--- client/src/main/java/org/teiid/jdbc/StatementImpl.java	(revision 3801)
+++ client/src/main/java/org/teiid/jdbc/StatementImpl.java	(working copy)
@@ -44,13 +44,13 @@
 import org.teiid.client.RequestMessage.ShowPlan;
 import org.teiid.client.metadata.ParameterInfo;
 import org.teiid.client.metadata.ResultsMetadataConstants;
-import org.teiid.client.metadata.ResultsMetadataDefaults;
 import org.teiid.client.plan.Annotation;
 import org.teiid.client.plan.PlanNode;
 import org.teiid.client.util.ResultsFuture;
 import org.teiid.core.TeiidComponentException;
 import org.teiid.core.TeiidException;
 import org.teiid.core.TeiidProcessingException;
+import org.teiid.core.types.DataTypeManager;
 import org.teiid.core.types.JDBCSQLTypeInfo;
 import org.teiid.core.types.SQLXMLImpl;
 import org.teiid.core.util.SqlUtil;
@@ -503,7 +503,7 @@
         				records.add(row);
         			}
         			createResultSet(records, new String[] {"PLAN_TEXT", "PLAN_XML", "DEBUG_LOG"}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        					new String[] {JDBCSQLTypeInfo.CLOB, JDBCSQLTypeInfo.XML, JDBCSQLTypeInfo.CLOB});
+        					new String[] {DataTypeManager.DefaultDataTypes.CLOB, DataTypeManager.DefaultDataTypes.XML, DataTypeManager.DefaultDataTypes.CLOB});
         			return booleanFuture(true);
         		}
         		if (show.equalsIgnoreCase("ANNOTATIONS")) { //$NON-NLS-1$
@@ -518,7 +518,7 @@
         				records.add(row);
         			}
         			createResultSet(records, new String[] {"CATEGORY", "PRIORITY", "ANNOTATION", "RESOLUTION"}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-        					new String[] {JDBCSQLTypeInfo.STRING, JDBCSQLTypeInfo.STRING, JDBCSQLTypeInfo.STRING, JDBCSQLTypeInfo.STRING});
+        					new String[] {DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.STRING});
         			return booleanFuture(true);
         		}
         		if (show.equalsIgnoreCase("ALL")) { //$NON-NLS-1$
@@ -530,11 +530,11 @@
         				records.add(row);
         			}
         			createResultSet(records, new String[] {"NAME", "VALUE"}, //$NON-NLS-1$ //$NON-NLS-2$
-        					new String[] {JDBCSQLTypeInfo.STRING, JDBCSQLTypeInfo.STRING});
+        					new String[] {DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.STRING});
         			return booleanFuture(true);
         		}
         		List<List<String>> records = Collections.singletonList(Collections.singletonList(driverConnection.getExecutionProperties().getProperty(JDBCURL.getValidKey(show))));
-    			createResultSet(records, new String[] {show}, new String[] {JDBCSQLTypeInfo.STRING});
+    			createResultSet(records, new String[] {show}, new String[] {DataTypeManager.DefaultDataTypes.STRING});
         		return booleanFuture(true);
         	}
         }
@@ -1086,7 +1086,7 @@
 	    metadataMap.put(ResultsMetadataConstants.GROUP_NAME, tableName);
 	    metadataMap.put(ResultsMetadataConstants.ELEMENT_NAME, columnName);
 	    metadataMap.put(ResultsMetadataConstants.DATA_TYPE, dataType);
-	    metadataMap.put(ResultsMetadataConstants.PRECISION, ResultsMetadataDefaults.getDefaultPrecision(dataType));
+	    metadataMap.put(ResultsMetadataConstants.PRECISION, JDBCSQLTypeInfo.getDefaultPrecision(dataType));
 	    metadataMap.put(ResultsMetadataConstants.RADIX, new Integer(10));
 	    metadataMap.put(ResultsMetadataConstants.SCALE, new Integer(0));
 	    metadataMap.put(ResultsMetadataConstants.AUTO_INCREMENTING, Boolean.FALSE);
@@ -1096,7 +1096,7 @@
 	    metadataMap.put(ResultsMetadataConstants.SIGNED, signed);
 	    metadataMap.put(ResultsMetadataConstants.WRITABLE, writable);
 	    metadataMap.put(ResultsMetadataConstants.CURRENCY, Boolean.FALSE);
-	    metadataMap.put(ResultsMetadataConstants.DISPLAY_SIZE, ResultsMetadataDefaults.getMaxDisplaySize(dataType));
+	    metadataMap.put(ResultsMetadataConstants.DISPLAY_SIZE, JDBCSQLTypeInfo.getMaxDisplaySize(dataType));
 	
 	    return metadataMap;
 	}
Index: engine/src/main/java/org/teiid/dqp/internal/process/DQPWorkContext.java
===================================================================
--- engine/src/main/java/org/teiid/dqp/internal/process/DQPWorkContext.java	(revision 3801)
+++ engine/src/main/java/org/teiid/dqp/internal/process/DQPWorkContext.java	(working copy)
@@ -51,17 +51,24 @@
 	private static final long serialVersionUID = -6389893410233192977L;
 	
 	public enum Version {
-		SEVEN_1("7.1"), //$NON-NLS-1$
-		SEVEN_2("7.2"), //$NON-NLS-1$
-		SEVEN_3("7.3"), //$NON-NLS-1$
-		SEVEN_4("7.4"), //$NON-NLS-1$
-		SEVEN_5("7.5"), //$NON-NLS-1$
-		SEVEN_6("7.6"); //$NON-NLS-1$
+		SEVEN_1("7.1", (byte)0), //$NON-NLS-1$
+		SEVEN_2("7.2", (byte)0), //$NON-NLS-1$
+		SEVEN_3("7.3", (byte)0), //$NON-NLS-1$
+		SEVEN_4("7.4", (byte)0), //$NON-NLS-1$
+		SEVEN_5("7.5", (byte)0), //$NON-NLS-1$
+		SEVEN_6("7.6", (byte)0), //$NON-NLS-1$
+		EIGHT_0("8.0", (byte)1); //$NON-NLS-1$
 		
 		private String string;
+		private byte clientSerializationVersion;
 		
-		private Version(String string) {
+		private Version(String string, byte clientSerializationVersion) {
 			this.string = string;
+			this.clientSerializationVersion = clientSerializationVersion;
+		}
+		
+		public byte getClientSerializationVersion() {
+			return clientSerializationVersion;
 		}
 		
 		@Override
Index: common-core/src/main/java/org/teiid/core/types/basic/BlobToBinaryTransform.java
===================================================================
--- common-core/src/main/java/org/teiid/core/types/basic/BlobToBinaryTransform.java	(revision 0)
+++ common-core/src/main/java/org/teiid/core/types/basic/BlobToBinaryTransform.java	(revision 0)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.core.types.basic;
+
+import java.io.IOException;
+import java.sql.SQLException;
+
+import org.teiid.core.CorePlugin;
+import org.teiid.core.types.BinaryType;
+import org.teiid.core.types.BlobType;
+import org.teiid.core.types.DataTypeManager;
+import org.teiid.core.types.Transform;
+import org.teiid.core.types.TransformationException;
+import org.teiid.core.util.ObjectConverterUtil;
+
+
+public class BlobToBinaryTransform extends Transform {
+
+    /**
+     * This method transforms a value of the source type into a value
+     * of the target type.
+     * @param value Incoming value of source type
+     * @return Outgoing value of target type
+     * @throws TransformationException if value is an incorrect input type or
+     * the transformation fails
+     */
+    public Object transformDirect(Object value) throws TransformationException {
+        BlobType source = (BlobType)value;
+        
+        try {
+        	byte[] bytes = ObjectConverterUtil.convertToByteArray(source.getBinaryStream(), DataTypeManager.MAX_LOB_MEMORY_BYTES, true);
+            return new BinaryType(bytes);         
+        } catch (SQLException e) {
+            throw new TransformationException(e, CorePlugin.Util.getString("failed_convert", new Object[] {getSourceType().getName(), getTargetType().getName()})); //$NON-NLS-1$            
+        } catch(IOException e) {
+            throw new TransformationException(e, CorePlugin.Util.getString("failed_convert", new Object[] {getSourceType().getName(), getTargetType().getName()})); //$NON-NLS-1$
+        } 
+    }
+
+    /** 
+     * @see org.teiid.core.types.Transform#isExplicit()
+     */
+    public boolean isExplicit() {
+        return true;
+    }
+
+	@Override
+	public Class<?> getSourceType() {
+		return DataTypeManager.DefaultDataClasses.BLOB;
+	}
+
+	@Override
+	public Class<?> getTargetType() {
+		return DataTypeManager.DefaultDataClasses.VARBINARY;
+	}
+}
Index: client/src/test/java/org/teiid/jdbc/util/ResultSetUtil.java
===================================================================
--- client/src/test/java/org/teiid/jdbc/util/ResultSetUtil.java	(revision 3801)
+++ client/src/test/java/org/teiid/jdbc/util/ResultSetUtil.java	(working copy)
@@ -553,7 +553,7 @@
         private BufferedReader in;
         private int line = 0;
         
-        private ArrayList unequalLines = new ArrayList();
+        private ArrayList<String> unequalLines = new ArrayList<String>();
         
         private ComparingPrintStream(OutputStream out, BufferedReader in) {
             super(out);
@@ -645,14 +645,14 @@
             try {
                 String expectedLine = in.readLine();
                 if (!bufferedLine.equals(expectedLine)) {
-                    unequalLines.add("\n" + new Integer(line) + ":" + bufferedLine );
+                    unequalLines.add("\n" + line + " expected: " +expectedLine+ " but was: " + bufferedLine );
                 }
             } catch (IOException e) {
                 
             }
         }
         
-        public List getUnequalLines() {
+        public List<String> getUnequalLines() {
             return unequalLines;
         }
     }
Index: api/src/main/java/org/teiid/translator/TypeFacility.java
===================================================================
--- api/src/main/java/org/teiid/translator/TypeFacility.java	(revision 3801)
+++ api/src/main/java/org/teiid/translator/TypeFacility.java	(working copy)
@@ -30,6 +30,7 @@
 import java.util.Date;
 import java.util.TimeZone;
 
+import org.teiid.core.types.BinaryType;
 import org.teiid.core.types.BlobType;
 import org.teiid.core.types.ClobType;
 import org.teiid.core.types.DataTypeManager;
@@ -62,6 +63,7 @@
 		public static final int CLOB = DataTypeManager.DefaultTypeCodes.CLOB;
 		public static final int XML = DataTypeManager.DefaultTypeCodes.XML;
 		public static final int NULL = DataTypeManager.DefaultTypeCodes.NULL;
+		public static final int VARBINARY = DataTypeManager.DefaultTypeCodes.VARBINARY;
 	}
 
     public interface RUNTIME_TYPES {
@@ -84,6 +86,8 @@
         public static final Class<ClobType> CLOB          = DataTypeManager.DefaultDataClasses.CLOB;
         public static final Class<XMLType> XML           = DataTypeManager.DefaultDataClasses.XML;
         public static final Class<NullType> NULL         = DataTypeManager.DefaultDataClasses.NULL;
+        public static final Class<BinaryType> VARBINARY         = DataTypeManager.DefaultDataClasses.VARBINARY;
+        
     }
     
     public static final class RUNTIME_NAMES {
@@ -106,6 +110,7 @@
         public static final String BLOB         = DataTypeManager.DefaultDataTypes.BLOB;
         public static final String CLOB         = DataTypeManager.DefaultDataTypes.CLOB;
         public static final String XML         	= DataTypeManager.DefaultDataTypes.XML;
+        public static final String VARBINARY         	= DataTypeManager.DefaultDataTypes.VARBINARY;
     }
     
     /**
Index: engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
===================================================================
--- engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj	(revision 3801)
+++ engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj	(working copy)
@@ -398,7 +398,8 @@
 |   < STRINGVAL: (("N"|"E")? "'" ( ("''") | ~["'"] )* "'") >
 |	< #LETTER: (["a"-"z","A"-"Z"] | ["\u0153"-"\ufffd"]) >
 |	< #DIGIT: ["0"-"9"] >
-
+|   < BINARYSTRINGVAL: ("X"|"x" "'" ( <HEXIT><HEXIT> )+ "'") >
+|	< #HEXIT: (["a"-"f","A"-"F"] | <DIGIT> ) >
 }
 
 TOKEN : /* Punctuation */
@@ -4013,6 +4014,7 @@
 				throw new ParseException(QueryPlugin.Util.getString("SQLParser.decimal_parse", params)); //$NON-NLS-1$
 			}
 		}   |
+		t=<BINARYSTRINGVAL> { constant = new Constant(new BinaryType(javax.xml.bind.DatatypeConverter.parseHexBinary(t.image.substring(2, t.image.length() - 1))), DataTypeManager.DefaultDataClasses.VARBINARY); } |
 		t=<FALSE>    { constant = new Constant(Boolean.FALSE, DataTypeManager.DefaultDataClasses.BOOLEAN); } |
 		t=<TRUE>     { constant = new Constant(Boolean.TRUE, DataTypeManager.DefaultDataClasses.BOOLEAN); }  |
         t=<UNKNOWN>  { constant = new Constant(null, DataTypeManager.DefaultDataClasses.BOOLEAN); }       |
Index: engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java
===================================================================
--- engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java	(revision 3801)
+++ engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java	(working copy)
@@ -34,10 +34,10 @@
 import org.teiid.api.exception.query.QueryResolverException;
 import org.teiid.client.metadata.MetadataResult;
 import org.teiid.client.metadata.ResultsMetadataConstants;
-import org.teiid.client.metadata.ResultsMetadataDefaults;
 import org.teiid.core.TeiidComponentException;
 import org.teiid.core.TeiidProcessingException;
 import org.teiid.core.types.DataTypeManager;
+import org.teiid.core.types.JDBCSQLTypeInfo;
 import org.teiid.core.types.XMLType;
 import org.teiid.dqp.internal.process.DQPCore.ClientState;
 import org.teiid.dqp.internal.process.DQPWorkContext.Version;
@@ -76,6 +76,8 @@
  */
 public class MetaDataProcessor {
 
+    public final static String XML_COLUMN_NAME = "xml"; //$NON-NLS-1$
+
     // Resources
     private DQPCore requestManager;
     private QueryMetadataInterface metadata;
@@ -248,10 +250,10 @@
 
     private Map createXMLColumnMetadata(Query xmlCommand) {
         GroupSymbol doc = xmlCommand.getFrom().getGroups().get(0);
-        Map xmlMetadata = getDefaultColumn(doc.getName(), ResultsMetadataDefaults.XML_COLUMN_NAME, XMLType.class);
+        Map xmlMetadata = getDefaultColumn(doc.getName(), XML_COLUMN_NAME, XMLType.class);
 
         // Override size as XML may be big        
-        xmlMetadata.put(ResultsMetadataConstants.DISPLAY_SIZE, ResultsMetadataDefaults.XML_COLUMN_LENGTH);
+        xmlMetadata.put(ResultsMetadataConstants.DISPLAY_SIZE, JDBCSQLTypeInfo.XML_COLUMN_LENGTH);
         
         return xmlMetadata;
     }
@@ -364,7 +366,7 @@
                 return precision;
             }
         }
-        return ResultsMetadataDefaults.getDefaultPrecision(dataType).intValue();
+        return JDBCSQLTypeInfo.getDefaultPrecision(dataType).intValue();
     }
     
     /**
@@ -416,7 +418,7 @@
            }
        }
        // else BOOLEAN, DATE, TIME, TIMESTAMP, CHARACTER use max
-       return ResultsMetadataDefaults.getMaxDisplaySize(dataType);
+       return JDBCSQLTypeInfo.getMaxDisplaySize(dataType);
     }
 
     public Map<Integer, Object> getDefaultColumn(String tableName, String columnName, 
@@ -441,12 +443,12 @@
         column.put(ResultsMetadataConstants.WRITABLE, Boolean.TRUE);
         column.put(ResultsMetadataConstants.CURRENCY, Boolean.FALSE);
         column.put(ResultsMetadataConstants.DATA_TYPE, DataTypeManager.getDataTypeName(javaType));
-        column.put(ResultsMetadataConstants.RADIX, ResultsMetadataDefaults.DEFAULT_RADIX);
-        column.put(ResultsMetadataConstants.SCALE, ResultsMetadataDefaults.DEFAULT_SCALE);
+        column.put(ResultsMetadataConstants.RADIX, JDBCSQLTypeInfo.DEFAULT_RADIX);
+        column.put(ResultsMetadataConstants.SCALE, JDBCSQLTypeInfo.DEFAULT_SCALE);
         column.put(ResultsMetadataConstants.SIGNED, Boolean.TRUE);
         
-        column.put(ResultsMetadataConstants.PRECISION, ResultsMetadataDefaults.getDefaultPrecision(javaType));
-        column.put(ResultsMetadataConstants.DISPLAY_SIZE, ResultsMetadataDefaults.getMaxDisplaySize(javaType));
+        column.put(ResultsMetadataConstants.PRECISION, JDBCSQLTypeInfo.getDefaultPrecision(javaType));
+        column.put(ResultsMetadataConstants.DISPLAY_SIZE, JDBCSQLTypeInfo.getMaxDisplaySize(javaType));
         return column;        
     }
     
Index: engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java
===================================================================
--- engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java	(revision 3801)
+++ engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java	(working copy)
@@ -1152,6 +1152,8 @@
                 constantParts = new String[] {"{t'", obj.getValue().toString(), "'}"}; //$NON-NLS-1$ //$NON-NLS-2$
             } else if (type.equals(DataTypeManager.DefaultDataClasses.DATE)) {
                 constantParts = new String[] {"{d'", obj.getValue().toString(), "'}"}; //$NON-NLS-1$ //$NON-NLS-2$
+            } else if (type.equals(DataTypeManager.DefaultDataClasses.VARBINARY)) {
+            	constantParts = new String[] {"X'", obj.getValue().toString(), "'"}; //$NON-NLS-1$ //$NON-NLS-2$
             }
             if (constantParts == null) {
                 String strValue = obj.getValue().toString();
Index: build/kits/jboss-as7/docs/teiid/teiid-releasenotes.html
===================================================================
--- build/kits/jboss-as7/docs/teiid/teiid-releasenotes.html	(revision 3801)
+++ build/kits/jboss-as7/docs/teiid/teiid-releasenotes.html	(working copy)
@@ -38,6 +38,7 @@
   <LI><B>Texttable selectors</B> - can be used to selectively parse only record lines matching a given selector string.  Selectors may also be used for column values to join data from other records positionally.
   <LI><B>Comparable LOBs</B> - the system property org.teiid.comparableLobs can be set to use CLOB and BLOB values in comparison/sorting/grouping operations.
   <LI><B>Padded String Comparison</B> - the system property org.teiid.padSpace can be set to effectively right pad strings to the same length for comparison.
+  <LI><B>VARBINARY type support</B> - the Teiid VARBINARY type can now be used to support source BINARY and VARBINARY types.
 </UL>
 
 <h2><a name="Compatibility">Compatibility Issues</a></h2>
Index: client/src/main/java/org/teiid/jdbc/ResultSetImpl.java
===================================================================
--- client/src/main/java/org/teiid/jdbc/ResultSetImpl.java	(revision 3801)
+++ client/src/main/java/org/teiid/jdbc/ResultSetImpl.java	(working copy)
@@ -27,20 +27,7 @@
 import java.io.Reader;
 import java.math.BigDecimal;
 import java.net.URL;
-import java.sql.Array;
-import java.sql.Blob;
-import java.sql.Clob;
-import java.sql.Date;
-import java.sql.NClob;
-import java.sql.Ref;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.RowId;
-import java.sql.SQLException;
-import java.sql.SQLWarning;
-import java.sql.SQLXML;
-import java.sql.Time;
-import java.sql.Timestamp;
+import java.sql.*;
 import java.util.Calendar;
 import java.util.List;
 import java.util.Map;
@@ -59,6 +46,7 @@
 import org.teiid.client.util.ResultsFuture;
 import org.teiid.core.TeiidComponentException;
 import org.teiid.core.TeiidProcessingException;
+import org.teiid.core.types.BinaryType;
 import org.teiid.core.types.BlobImpl;
 import org.teiid.core.types.BlobType;
 import org.teiid.core.types.ClobImpl;
@@ -324,6 +312,10 @@
         	String val = (String)currentValue;
         	currentValue = val.substring(0, Math.min(maxFieldSize/2, val.length()));
         }
+        else if (currentValue instanceof BinaryType) {
+        	BinaryType val = (BinaryType)currentValue;
+        	currentValue = val.getBytesDirect();
+        }
         return currentValue;
     }
     
Index: engine/src/main/java/org/teiid/common/buffer/impl/SizeUtility.java
===================================================================
--- engine/src/main/java/org/teiid/common/buffer/impl/SizeUtility.java	(revision 3801)
+++ engine/src/main/java/org/teiid/common/buffer/impl/SizeUtility.java	(working copy)
@@ -31,6 +31,7 @@
 import java.util.Map;
 import java.util.Set;
 
+import org.teiid.core.types.BinaryType;
 import org.teiid.core.types.DataTypeManager;
 
 
@@ -48,6 +49,7 @@
 	private static Set<Class<?>> VARIABLE_SIZE_TYPES = new HashSet<Class<?>>();
 	static {
 		SIZE_ESTIMATES.put(DataTypeManager.DefaultDataClasses.STRING, new int[] {100, 256});
+		SIZE_ESTIMATES.put(DataTypeManager.DefaultDataClasses.VARBINARY, new int[] {100, 256});
 		SIZE_ESTIMATES.put(DataTypeManager.DefaultDataClasses.DATE, new int[] {20, 28});
 		SIZE_ESTIMATES.put(DataTypeManager.DefaultDataClasses.TIME, new int[] {20, 28});
 		SIZE_ESTIMATES.put(DataTypeManager.DefaultDataClasses.TIMESTAMP, new int[] {20, 28});
@@ -64,6 +66,7 @@
 		SIZE_ESTIMATES.put(DataTypeManager.DefaultDataClasses.BIG_INTEGER, new int[] {75, 100});
 		SIZE_ESTIMATES.put(DataTypeManager.DefaultDataClasses.BIG_DECIMAL, new int[] {150, 200});
 		VARIABLE_SIZE_TYPES.add(DataTypeManager.DefaultDataClasses.STRING);
+		VARIABLE_SIZE_TYPES.add(DataTypeManager.DefaultDataClasses.VARBINARY);
 		VARIABLE_SIZE_TYPES.add(DataTypeManager.DefaultDataClasses.OBJECT);
 		VARIABLE_SIZE_TYPES.add(DataTypeManager.DefaultDataClasses.BIG_INTEGER);
 		VARIABLE_SIZE_TYPES.add(DataTypeManager.DefaultDataClasses.BIG_DECIMAL);
@@ -130,6 +133,12 @@
                 return alignMemory(40 + (2 * length));
             }
             return 40;
+        } else if(type == DataTypeManager.DefaultDataClasses.VARBINARY) {
+            int length = ((BinaryType)obj).getLength();
+            if (length > 0) {
+                return alignMemory(16 + length);
+            }
+            return 16;
         } else if(type == DataTypeManager.DefaultDataClasses.BIG_DECIMAL) {
         	if (!updateEstimate) {
         		return bigDecimalEstimate;
Index: client/src/main/java/org/teiid/client/metadata/ResultsMetadataDefaults.java
===================================================================
--- client/src/main/java/org/teiid/client/metadata/ResultsMetadataDefaults.java	(revision 3801)
+++ client/src/main/java/org/teiid/client/metadata/ResultsMetadataDefaults.java	(working copy)
@@ -1,118 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.client.metadata;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.teiid.core.types.DataTypeManager;
-
-
-
-/** 
- * @since 4.2
- */
-public class ResultsMetadataDefaults {
-    public static final Integer DEFAULT_RADIX = new Integer(10);
-    public static final Integer DEFAULT_SCALE = new Integer(0);
-
-    // XML column constants
-    public final static String XML_COLUMN_NAME = "xml"; //$NON-NLS-1$
-    public final static Integer XML_COLUMN_LENGTH = new Integer(Integer.MAX_VALUE);
-
-    // Update constants
-    public static final String UPDATE_COLUMN = "count"; //$NON-NLS-1$
-
-    /** Maximum display size for the data type (Class -> Integer) */
-    private static final Map<String, Integer> MAX_DISPLAY_SIZE = new HashMap<String, Integer>();
-    /** Default precision for a data type (String -> Integer) */
-    private static final Map<String, Integer> DEFAULT_PRECISION = new HashMap<String, Integer>();
-
-    static {
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.BIG_DECIMAL, new Integer(22));
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.BIG_INTEGER, new Integer(20));
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.BLOB, new Integer(Integer.MAX_VALUE));
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.BOOLEAN, new Integer(5));
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.BYTE, new Integer(4));
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.CHAR, new Integer(1));
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.CLOB, new Integer(Integer.MAX_VALUE));
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.DATE, new Integer(10));
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.DOUBLE, new Integer(22));
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.FLOAT, new Integer(22));
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.INTEGER, new Integer(11));
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.LONG, new Integer(20));
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.NULL, new Integer(0));
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.OBJECT, new Integer(Integer.MAX_VALUE));
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.SHORT, new Integer(6));
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.STRING, new Integer(DataTypeManager.MAX_STRING_LENGTH));
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.TIME, new Integer(8));
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.TIMESTAMP, new Integer(29));
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.XML, new Integer(Integer.MAX_VALUE));
-        MAX_DISPLAY_SIZE.put(DataTypeManager.DefaultDataTypes.NULL, 4);
-
-        /* NOTE1
-         * For non-numeric columns (BLOB, BOOLEAN, CHAR, CLOB, DATE, OBJECT, STRING, TIME, TIMESTAMP, XML),
-         * the default precision should be the max allowed length of the column
-         */
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.BIG_DECIMAL, new Integer(20));
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.BIG_INTEGER, new Integer(19));
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.BLOB, new Integer(Integer.MAX_VALUE));
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.BOOLEAN, new Integer(1));
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.BYTE, new Integer(3));
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.CHAR, new Integer(1));
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.CLOB, new Integer(Integer.MAX_VALUE));
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.DATE, new Integer(10));
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.DOUBLE, new Integer(20));
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.FLOAT, new Integer(20));
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.INTEGER, new Integer(10));
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.LONG, new Integer(19));
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.NULL, new Integer(0));
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.OBJECT, new Integer(Integer.MAX_VALUE));
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.SHORT, new Integer(5));
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.STRING, new Integer(DataTypeManager.MAX_STRING_LENGTH));
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.TIME, new Integer(8));
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.TIMESTAMP, new Integer(29));
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.XML, new Integer(Integer.MAX_VALUE));
-        DEFAULT_PRECISION.put(DataTypeManager.DefaultDataTypes.NULL, 1);
-    }
-    
-    public static Integer getMaxDisplaySize(Class<?> dataTypeClass) {
-        return MAX_DISPLAY_SIZE.get(DataTypeManager.getDataTypeName(dataTypeClass));
-    }
-    
-    public static Integer getMaxDisplaySize(String typeName) {
-        return MAX_DISPLAY_SIZE.get(typeName);
-    }
-    
-    public static Integer getDefaultPrecision(Class<?> dataTypeClass) {
-        return DEFAULT_PRECISION.get(DataTypeManager.getDataTypeName(dataTypeClass));
-    }
-    
-    public static Integer getDefaultPrecision(String typeName) {
-        return DEFAULT_PRECISION.get(typeName);
-    }
-    
-    /** Uninstantiable */
-    private ResultsMetadataDefaults() {}
-
-}
