Java examples for java.sql:Connection
get Statement from Connection
import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class Main{ public static Statement getStatement(Connection conn) { Statement stmt = null;/*from w w w . ja va2s .co m*/ try { if (conn != null) { stmt = conn.createStatement(); } } catch (SQLException e) { e.printStackTrace(); } return stmt; } }