%@ page import="java.util.*"%> <%@ page import="java.sql.*"%> <%@ page import="java.io.*"%> <%@ page import="java.net.URLEncoder"%> <%! public static String SITE_PROPERTY_FILE = "site.properties"; public static Properties properties; %> <%! public class City { int id; String code; String name; public City() {} public City( int id, String code, String name ) { this.id = id; this.code = code; this.name = name; } } %> <% if ( properties == null ) { try { String filePath = application.getRealPath( "/" ) + SITE_PROPERTY_FILE; FileInputStream in = new FileInputStream( filePath ); properties = new Properties(); properties.load( in ); } catch (IOException ioe) { out.println( ioe.getMessage() ); } } boolean debug = false; Connection conn = null; Statement stmt = null; ResultSet res = null; String url = (String)properties.get( "dbURL" ); String user = (String)properties.get( "dbUser" ); String pwd = (String)properties.get( "dbPwd" ); String requestURL = (String)properties.get( "jobPage" ); int coopCategoryId = Integer.parseInt((String)properties.get( "coopCategoryId" )); String attributes = null; String positionCode = ""; String objective = ""; String responsibility = ""; String experience = ""; String title = ""; int catId = 0; List availCities = null; Hashtable notAvailCities = null; int position_id = 1; if (request.getParameter( "id" ) != null) position_id = Integer.parseInt( request.getParameter( "id" ) ); String detailsQuery = "SELECT pos.* FROM Position pos WHERE position_id = " + position_id; String cityQuery = "SELECT p.position_name, l.location_name, l.location_code, l.location_id, pl.currently_available " + "FROM Position p, Location l, Position_Location pl " + "WHERE p.position_id = pl.position_id " + "AND l.location_id = pl.location_id " + "AND p.position_id = " + position_id; // Instantiate the driver try { Class.forName( (String)properties.get( "dbDriver" ) ); } catch ( java.lang.ClassNotFoundException e ) { out.println( "Class not found" ); } // Create the Connection and execute sql query try { conn = DriverManager.getConnection( url, user, pwd ); stmt = conn.createStatement(); res = stmt.executeQuery( detailsQuery ); } catch ( SQLException e ) { out.println( "sql exception" + e.getMessage() ); } try { while ( res.next() ) { positionCode = res.getString( "position_code" ); title = res.getString( "position_name" ); objective = res.getString( "objective" ); responsibility = res.getString( "responsibility_html" ); experience = res.getString( "experience_html" ); attributes = res.getString( "attribute_html" ); catId = res.getInt( "category_id" ); } } catch (SQLException e) { out.println( e.getMessage() ); } // Create the Connection and execute sql query try { res = stmt.executeQuery( cityQuery ); } catch ( SQLException e ) { out.println( "sql exception" + e.getMessage() ); } //Put the available cities into a list of City objects availCities = new ArrayList(); try { while ( res.next() ) { if ( res.getInt( "currently_available" ) == 1 ) { City temp = new City(); temp.id = res.getInt( "location_id" ); temp.code = res.getString( "location_code" ); temp.name = res.getString( "location_name" ); availCities.add( temp ); } } } catch ( SQLException e ) { out.println( e.getMessage() ); } catch ( Exception e ) { out.println( e.getMessage() ); } try { conn.close(); } catch ( SQLException e ) { out.println( "SQL Exception" + e.getMessage() ); } finally { conn.close(); } // Manipulate the title string for output char[] titleArr = title.toUpperCase().toCharArray(); if ( debug ) { out.println( properties.toString() ); out.println( "available cities: " + availCities.toString() ); out.println( "unavailable cities: " + notAvailCities.toString() ); } %>
|
||||
|
<% if ( request.getParameter( "id" ).equals("179") ) {
for ( int i=0; i < titleArr.length; i++ ) {
if ( titleArr[i] == ' ' ) {
out.print( " " );
} else if (titleArr[i] == ',' && i > 30) {
out.print( titleArr[i] + " " ); } else { out.print( titleArr[i] + " " ); } } } else { for ( int i=0; i < titleArr.length; i++ ) { if ( titleArr[i] == ' ' ) { out.print( " " ); } else { out.print( titleArr[i] + " " ); } } } %> / <% //parse the content for newlines and replace them with html breaks StringTokenizer parsedContent = new StringTokenizer( objective, "\n" ); while ( parsedContent.hasMoreTokens() ) { out.print( parsedContent.nextToken() + " " ); } %> RESPONSIBILITIES / <%=responsibility %> REQUIRED SKILLS / EXPERIENCE / <%=experience %> <% if ( attributes != null && attributes.length() > 0 ) { %> ATTRIBUTES / <%=attributes%> <% } //end if %> [back] [top] |
APPLY / Apply for this job in <% for ( Iterator i = availCities.iterator(); i.hasNext(); ) { City city = (City)i.next(); %> <% } //end for %> TELL A FRIEND / " onClick="openCenteredWindow(this.href,'friend',320,460); return false;">Tell a friend about this job. AGENCIES / Solicitation will only be accepted via Human Resources. <%//if job category is coops and interns, do show this if(catId == coopCategoryId ) {%> CO-OPS AND INTERNSHIPS / Occasionally, Blast Radius has co-op and internship opportunities for bright individuals with track records of outstanding achievements. Positions are posted as they become available. If you would like to submit your resume for future consideration, please contact us at interns@blastradius.com. <% } %> |