You are on page 1of 1

/** * JDBC Stored Procedure ADMINISTRATOR.D2005SAMPLE * @param JOBCODE */ import java.sql.

*; // JDBC classes public class D2005SAMPLE { public static void d2005SAMPLE ( String JOBCODE, ResultSet[] rs1 ) throws SQLException, Exce ption { // Get connection to the database Connection con = DriverManager.getConnection("jdbc:default:connection"); PreparedStatement stmt = null; String sql; sql = "SELECT" + " EMPLOYEE.FIRSTNME," + " EMPLOYEE.MIDINIT," + " EMPLOYEE.LASTNAME," + " EMPLOYEE.WORKDEPT" + " FROM" + " EMPLOYEE" + " WHERE" + " (EMPLOYEE.JOB = ?)"; stmt = con.prepareStatement(sql); stmt.setString(1, JOBCODE); rs1[0] = stmt.executeQuery(); if (con != null) con.close(); } }

You might also like