- getNString() 方法 api
-
String
getNString(String columnLabel)
获取指定列的值在当前行
ResultSet
对象作为String
在Java编程语言
-
-
-
String
getNString(int columnIndex)
Retrieves the value of the designated column in the current row of this
ResultSet
object as aString
in the Java programming language.
-
getNString()方法 api解释
- getString() api
-
String
getString(String columnLabel)
获取指定列的值在当前行
ResultSet
对象作为String
在Java编程语言
-
-
-
String
getString(int columnIndex)
Retrieves the value of the designated column in the current row of this
ResultSet
object as aString
in the Java programming language
-
相比之下,getNString()如果查询了属性不为NCHAR、NVARCHAR、LONGNVARCHAR的字段,会报错。
This getNString method is specified by the getNString method in the java.sql.SQLServerResultSet interface.
This method can be used to retrieve the value of an nvarchar, nchar, nvarchar(max), ntext, or xml column in the current row of this SQLServerResultSet object. If you try to use this method to retrieve values of other data types, an exception will be thrown.
getString()可以查询所有,并不会报错。若非字符或字符串,则会toString一下。
This getString method is specified by the getString method in the java.sql.CallableStatement interface.
All columns in SQL Server can be returned as a string. This means that a string representation of all number-based and character-based types, and a hex-string representation of binary columns such as binary, varbinary, varbinary(max), image, timestamp, and uniqueidentifier, can be returned.
Location-sensitive types such as money, smallmoney, datetime, smalldatetime, float, real, decimal, and numeric will return the canonical toString() format for the underlying value of the type.
User-defined types are returned as hexadecimal string values.
这个getString方法由java . sql中的getString方法指定。
CallableStatement接口。
SQL Server中的所有列都可以作为字符串返回。
这意味着,所有基于数字和字符的类型的字符串表示,以及二进制列(如二进制、varbinary、varbinary(max)、图像、时间戳和唯一的识别符等二进制列的hex字符串表示,都可以返回。
位置敏感类型,如货币、smallmoney、datetime、smalldatetime、float、real、decimal和数值,将返回典型的toString()格式,以确定类型的底层值。
用户定义类型返回为十六进制字符串值。