Working with Data Types (JDBC)

DownloadDownload JDBC Driver

The primary function of the Microsoft JDBC Driver for SQL Server is to allow Java developers to access data contained in SQL Server databases. To accomplish this, the JDBC driver mediates the conversion between SQL Server data types and Java language types and objects.


For a detailed discussion of the SQL Server and JDBC driver data types, including their differences and how they are converted to Java language data types, see Understanding the JDBC Driver Data Types.

In order to work with SQL Server data types, the JDBC driver provides get<Type> and set<Type> methods for the SQLServerPreparedStatement and SQLServerCallableStatement classes, and it provides get<Type> and update<Type> methods for the SQLServerResultSet class. Which method you use depends on the type of data that you are working with, and whether you are using result sets or queries.

The topics in this section describe how to use the JDBC driver data types to access SQL Server data in your Java applications.

In This Section

Topic Description
Basic Data Types Sample Describes how to use result set getter methods to retrieve basic SQL Server data type values, and how to use result set update methods to update those values.
SQLXML Data Type Sample Describes how to store an XML data in a relational database, how to retrieve an XML data from a database, and how to parse an XML data with the SQLXML Java data type.

See Also

Sample JDBC Driver Applications