title: Prepared Statement Execution in eclipse
body: <pre><code>public static void main(String[] args)
  {
      Connection con=null;
      PreparedStatement pstmt=null;
      ResultSet rs=null;
      /*
       * 1.load the driver
       * driver class :com.mysql.jdbc.Driver
  
       */
  
      try {
          Driver driverref=new Driver();
          DriverManager.registerDriver(driverref);
          /*
           * 2.get db connection via driver
           */
          String DbUrl="jdbc:mysql://localhost:3306/college?user=suhas&amp;password=j2ee";
          con=DriverManager.getConnection(DbUrl);
          /*
           * 3.issue SQL queries via Connection
           */
          String query="select * from Students_info where regno=?"
           +"firstname=?";
          pstmt=con.prepareStatement(query);
          String regnum=args[0];
          int regno=Integer.parseInt(regnum);
          pstmt.setInt(1,regno);
          pstmt.setString(2, args[1]);
          rs=pstmt.executeQuery();
          /*
           * 4.process the results returned by sql query
           */
          while(rs.next()){
              int dbregno=rs.getInt("regno");
              String fname=rs.getString("firstname");
              String mname=rs.getString("middlename");
              String lname=rs.getString("lastname");
              System.out.println("regno "+dbregno);
              System.out.println("first name "+fname );
              System.out.println("middlename "+mname);
              System.out.println("lastname "+lname);
              }//end of while
      }
      catch (SQLException e) 
      {
          e.printStackTrace();
      }
      finally{
          /*
           * close all jdbc objects
           */
          try {
              if(con!=null){
                  con.close();
  
              }
              if(pstmt!=null){
                  pstmt.close();
              }
              if(rs!=null){
                  rs.close();
              }
          } catch (SQLException e) {
  
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>}
  with the above code am not able to pass the args value in run configurations.Am getting an number format exception how to fix this.How to pass the args in Arguments tab of run configurations.</p>