Java examples for java.sql:ResultSet
get Single Result Double from PreparedStatement
//package com.java2s; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static Double getSingleResultDouble(PreparedStatement ps) throws SQLException { Double retval;/*from ww w. j a v a 2 s. co m*/ ResultSet rs = ps.executeQuery(); if (rs.next()) retval = rs.getDouble(1); else retval = null; rs.close(); return retval; } }