<html>
<head>
<title>jTDS native to JDBC data type mapping</title>
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<table class="mainTable" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="3" class="logoWrapper">
      <table cellpadding="0" cellspacing="0" class="logo">
        <tr>
          <td class="logo"><img src="images/logo.gif" alt="The jTDS Project" class="logo"></td>
          <td class="logo"><img src="images/logoBg.gif" class="logoBg"></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr>
    <td width="9" height="9"><img src="images/maintl.gif" width="9" height="9"></td>
    <td height="9" background="images/maint.gif"><img src="images/spacer.gif"></td>
    <td width="9" height="9"><img src="images/maintr.gif" width="9" height="9"></td>
  </tr>
  <tr>
    <td width="9" background="images/mainl.gif"><img src="images/spacer.gif"></td>
    <td class="content">
      <p class="links">
        <a href="index.html">Home</a>
        | <a href="faq.html">FAQ</a>
        | <a href="doc.html">Documentation</a>
        | <a href="links.html">Links</a>
        | <a href="license.html">License</a>
        | <a href="http://sourceforge.net/projects/jtds">Project Info</a>
        | <a href="http://sourceforge.net/projects/jtds/files">Download</a>
        | <a href="http://sourceforge.net/p/jtds/news">News</a>
        | <a href="http://sourceforge.net/p/jtds/bugs">Bugs</a>
        | <a href="http://sourceforge.net/p/jtds/discussion">Forums</a>
      </p>


<!--
==================================
  Content starts here
==================================
-->


<p class="title">jTDS native type mapping</p>
<p>Below is the mapping between native SQL types and java objects.</p>

<table class="inner" cellspacing="0">
<tr>
<th align="left">Native type</th><th align="left">Java Object</th><th align="left">JDBC Type</th><th align="left">Comment</th>
</tr>
<tr>
<td colspan="4"><p class="title">Numeric types</td>
</tr>
<tr>
<td>&nbsp;&nbsp;tinyint</td><td>java.lang.Integer</td><td>TINYINT</td><td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;&nbsp;smallint</td><td>java.lang.Integer</td><td>SMALLINT</td><td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;&nbsp;unsigned smallint</td><td>java.lang.Integer</td><td>INTEGER</td><td>Sybase only</td>
</tr>
<tr>
<td>&nbsp;&nbsp;int</td><td>java.lang.Integer</td><td>INTEGER</td><td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;&nbsp;unsigned int</td><td>java.lang.Integer</td><td>BIGINT</td><td>Sybase only</td>
</tr>
<tr>
<td>&nbsp;&nbsp;bigint</td><td>java.lang.Long</td><td>BIGINT</td><td>SQL 2000/Sybase 15+</td>
</tr>
<tr>
<td>&nbsp;&nbsp;unsigned bigint</td><td>java.math.BigDecimal</td><td>DECIMAL</td><td>Sybase only</td>
</tr>
<tr>
<td>&nbsp;&nbsp;numeric</td><td>java.math.BigDecimal</td><td>NUMERIC</td><td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;&nbsp;decimal</td><td>java.math.BigDecimal</td><td>DECIMAL</td><td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;&nbsp;smallmoney</td><td>java.math.BigDecimal</td><td>DECIMAL</td><td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;&nbsp;money</td><td>java.math.BigDecimal</td><td>DECIMAL</td><td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;&nbsp;real</td><td>java.lang.Float</td><td>REAL</td><td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;&nbsp;float</td><td>java.lang.Double</td><td>DOUBLE</td><td>&nbsp;</td>
</tr>
<tr>
<td colspan="4"><p class="title">Logical type</td>
</tr>
<tr>
<td>&nbsp;&nbsp;bit</td><td>java.lang.Boolean</td><td>BIT</td><td>&nbsp;</td>
</tr>
<tr>
<td colspan="4"><p class="title">Character types</td>
</tr>
<tr>
<td>&nbsp;&nbsp;char</td><td>java.lang.String</td><td>CHAR</td><td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;&nbsp;varchar</td><td>java.lang.String</d><td>VARCHAR</td><td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;&nbsp;nchar</td><td>java.lang.String</td><td>CHAR</td><td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;&nbsp;nvarchar</td><td>java.lang.String</td><td>VARCHAR</td><td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;&nbsp;unichar</td><td>java.lang.String</td><td>CHAR</td><td>Sybase only</td>
</tr>
<tr>
<td>&nbsp;&nbsp;univarchar</td><td>java.lang.String</td><td>VARCHAR</td><td>Sybase only</td>
</tr>
<tr>
<td>&nbsp;&nbsp;text</td><td>java.sql.Clob</td><td>CLOB</td><td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;&nbsp;ntext</td><td>java.sql.Clob</td><td>CLOB</td><td>Microsoft only</td>
</tr>
<tr>
<td>&nbsp;&nbsp;unitext</td><td>java.sql.Clob</td><td>CLOB</td><td>Sybase only</td>
</tr>
<tr>
<td colspan="4"><p class="title">Binary types</td>
</tr>
<tr>
<td>&nbsp;&nbsp;binary</td><td>byte[]</td><td>BINARY</td><td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;&nbsp;varbinary</td><td>byte[]</td><td>VARBINARY</td><td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;&nbsp;image</td><td>java.sql.Blob</td><td>BLOB</td><td>&nbsp;</td>
</tr>
<tr>
<td colspan="4"><p class="title">Datetime types</td>
</tr>
<tr>
<td>&nbsp;&nbsp;smalldatetime</td><td>java.sql.Timestamp</td><td>TIMESTAMP</td><td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;&nbsp;datetime</td><td>java.sql.Timestamp</td><td>TIMESTAMP</td><td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;&nbsp;date</td><td>java.sql.Date</td><td>DATE</td><td>Sybase only</td>
</tr>
<tr>
<td>&nbsp;&nbsp;time</td><td>java.sql.Time</td><td>TIME</td><td>Sybase only</td>
</tr>
<tr>
<td colspan="4"><p class="title">Other types</td>
</tr>
<tr>
<td>&nbsp;&nbsp;uniqueidentifier</td><td>java.lang.String</td><td>VARCHAR</td><td>Microsoft only</td>
</tr>
<tr>
<td>&nbsp;&nbsp;sql_variant</td><td>java.lang.String</td><td>VARCHAR</td><td>MS only TDS7</td>
</tr>
<tr>
<td>&nbsp;&nbsp;sql_variant</td><td>Depends on value</td><td>OTHER</td><td>MS only TDS8</td>
</tr>
</table>
    </td>
    <td width="9" background="images/mainr.gif"><img src="images/spacer.gif"></td>
  </tr>
  <tr>
    <td width="9" height="9"><img src="images/mainbl.gif" width="9" height="9"></td>
    <td height="9" background="images/mainb.gif"><img src="images/spacer.gif"></td>
    <td width="9" height="9"><img src="images/mainbr.gif" width="9" height="9"></td>
  </tr>
  <tr>
    <td colspan="3">
      <table border="0" cellspacing="0" width="100%" class="outer">
        <tr>
          <td class="copyright" width="150">
            Project hosted by<br><br>
            <A href="http://sourceforge.net/projects/jtds" target="_top"><IMG src="http://sourceforge.net/sflogo.php?group_id=33291&amp;type=2" border="0" alt="SourceForge Logo" class="otherLogo"></A><br>
          </td>
          <td width="500"/>
          <td class="copyright" width="150">
            Web Design<br><br>
            <a href="http://anca13.go.ro" class="outer">Anca Sinpalean</a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>
