Skip to content

Latest commit

 

History

History
80 lines (58 loc) · 3.16 KB

File metadata and controls

80 lines (58 loc) · 3.16 KB
title getObject Method (java.lang.String, java.util.Map) | Microsoft Docs
ms.custom
ms.date 01/19/2017
ms.prod sql
ms.prod_service drivers
ms.service
ms.component jdbc
ms.reviewer
ms.suite sql
ms.technology
drivers
ms.tgt_pltfrm
ms.topic article
apiname
SQLServerCallableStatement.getObject (java.lang.String, Java.util.Map)
apilocation
sqljdbc.jar
apitype Assembly
ms.assetid e174eb81-d569-479e-a171-365cd6d44b6a
caps.latest.revision 16
author MightyPen
ms.author genemi
manager jhubbard
ms.workload Inactive

getObject Method (java.lang.String, java.util.Map)

[!INCLUDEDriver_JDBC_Download]

Retrieves the value of the designated parameter as an object in the Java programming language given the parameter name, by using the given Map object.

Note

This method is not currently supported by the [!INCLUDEjdbcNoVersion]. Using this method will always return the default mapping.

Syntax

  
public java.lang.Object getObject(java.lang.String sCol,  
                                  java.util.Map m)  

Parameters

sCol

A String that contains the parameter name.

m

A Map object.

Return Value

An Object value.

Exceptions

SQLServerException

Remarks

This getObject method is specified by the getObject method in the java.sql.CallableStatement interface.

This method will return the value of the given column as a Java object. The type of the Java object will be the default Java object type corresponding to the SQL type of the column, following the mapping for built-in types that is specified in the JDBC specification. If the value is an SQL NULL, the driver returns a Java null.

This method can also be used to read database-specific abstract data types. In the JDBC 2.0 API, the behavior of the getObject method is extended to materialize data of SQL user-defined types. When a column contains a structured or distinct value, the behavior of this method is as if it were a call to getObject(columnIndex, this.getStatement().getConnection().getTypeMap()).

Beginning in the [!INCLUDEssNoVersion] JDBC Driver 3.0:

  • A value of type date will be returned as a java.sql.Date object.

  • A value of type time will be returned as a java.sql.Time object.

  • A value of type datetime2 will be returned as a java.sql.Timestamp object.

  • A value of type datetimeoffset will be returned as a microsoft.sql.DateTimeOffset object.

See Also

getObject Method (SQLServerCallableStatement)
SQLServerCallableStatement Members
SQLServerCallableStatement Class