get PreparedStatement - Java java.sql

Java examples for java.sql:PreparedStatement

Description

get PreparedStatement

Demo Code


//package com.java2s;
import java.sql.Connection;
import java.sql.PreparedStatement;

import java.sql.SQLException;

public class Main {

    public static PreparedStatement getPrepStatement(Connection conn,
            String sql) {/* www .ja va 2  s.co m*/
        PreparedStatement prepStmt = null;
        try {
            prepStmt = conn.prepareStatement(sql);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return prepStmt;
    }
}

Related Tutorials