Skip to content

Commit

Permalink
Web: Comment out unused code that may be incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
danjasuw committed Jun 28, 2018
1 parent 507b221 commit 364e87b
Showing 1 changed file with 64 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,69 +100,70 @@ public List<ProxlXMLFileImportTrackingStatusValLkupDTO> getAll( ) throws Excepti




/**
* @param id
* @return
* @throws Exception
*/
public ProxlXMLFileImportTrackingStatusValLkupDTO getForId( int id ) throws Exception {


ProxlXMLFileImportTrackingStatusValLkupDTO result = null;

Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;

final String sql = "SELECT * FROM proxl_xml_file_import_tracking WHERE id = ?";

try {

conn = DBConnectionFactory.getConnection( DBConnectionFactory.PROXL );

pstmt = conn.prepareStatement( sql );
pstmt.setInt( 1, id );

rs = pstmt.executeQuery();

if ( rs.next() ) {

result = populateResultObject( rs );
}

} catch ( Exception e ) {

String msg = "Failed to select ProxlXMLFileImportTrackingStatusValLkupDTO, id: " + id + ", sql: " + sql;

log.error( msg, e );

throw e;


} finally {

// be sure database handles are closed
if( rs != null ) {
try { rs.close(); } catch( Throwable t ) { ; }
rs = null;
}

if( pstmt != null ) {
try { pstmt.close(); } catch( Throwable t ) { ; }
pstmt = null;
}

if( conn != null ) {
try { conn.close(); } catch( Throwable t ) { ; }
conn = null;
}

}

return result;
}

// Unused Code. May be Incorrect. Validate it if you use it.
//
// /**
// * @param id
// * @return
// * @throws Exception
// */
// public ProxlXMLFileImportTrackingStatusValLkupDTO getForId( int id ) throws Exception {
//
//
// ProxlXMLFileImportTrackingStatusValLkupDTO result = null;
//
// Connection conn = null;
// PreparedStatement pstmt = null;
// ResultSet rs = null;
//
// final String sql = "SELECT * FROM proxl_xml_file_import_tracking_status_values_lookup WHERE id = ?";
//
// try {
//
// conn = DBConnectionFactory.getConnection( DBConnectionFactory.PROXL );
//
// pstmt = conn.prepareStatement( sql );
// pstmt.setInt( 1, id );
//
// rs = pstmt.executeQuery();
//
// if ( rs.next() ) {
//
// result = populateResultObject( rs );
// }
//
// } catch ( Exception e ) {
//
// String msg = "Failed to select ProxlXMLFileImportTrackingStatusValLkupDTO, id: " + id + ", sql: " + sql;
//
// log.error( msg, e );
//
// throw e;
//
//
// } finally {
//
// // be sure database handles are closed
// if( rs != null ) {
// try { rs.close(); } catch( Throwable t ) { ; }
// rs = null;
// }
//
// if( pstmt != null ) {
// try { pstmt.close(); } catch( Throwable t ) { ; }
// pstmt = null;
// }
//
// if( conn != null ) {
// try { conn.close(); } catch( Throwable t ) { ; }
// conn = null;
// }
//
// }
//
// return result;
// }
//

/**
* @param rs
Expand Down

0 comments on commit 364e87b

Please sign in to comment.