Here you can find the source of getShort(ResultSet res, String name)
Parameter | Description |
---|---|
res | a result set. |
name | a name of the column. |
Parameter | Description |
---|---|
SQLException | if an error occurs. |
public static Short getShort(ResultSet res, String name) throws SQLException
//package com.java2s; /*//w ww. j a v a 2s . co m * Copyright (c) 2015-2016 QuartzDesk.com. * Licensed under the MIT license (https://opensource.org/licenses/MIT). */ import java.sql.ResultSet; import java.sql.SQLException; public class Main { /** * Returns the values of the specified column as a Short. If the column * value is null, this method returns null. * * @param res a result set. * @param name a name of the column. * @return the value of the column. * @throws SQLException if an error occurs. */ public static Short getShort(ResultSet res, String name) throws SQLException { short v = res.getShort(name); return res.wasNull() ? null : v; } }