title: [Microsoft][ODBC Driver Manager] Invalid string or buffer length exception
body: <p>this is part of my code my code:</p>
  
  <pre><code>  Connection dbcon=null;
      Statement stm;
      ResultSet rs;
      ResultSetMetaData metadata;
      try {
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          } catch (java.lang.ClassNotFoundException e) {
          System.out.print("ClassNotFoundException: ");
              System.out.println(e.getMessage());         
          }
      try {
         dbcon = DriverManager.getConnection("jdbc:odbc:Bus_Info");
         stm = dbcon.createStatement();
          rs = stm.executeQuery("select distinct number, name, min(Stop_Times.departure_time), max(Stop_Times.departure_time) from Routes, Stop_Times, Stops, trips, Calendar where(stops.stop_name like'ΣΟΝΙΑ' and Stops.stop_id=Stop_Times.stop_id and Stop_Times.trip_id=trips.trip_id and trips.route_id=Routes.route_id and trips.direction='outbound' and sunday=1 and Calendar.service_id=trips.service_id)group by number, name");
  
          metadata = rs.getMetaData();
          int columns = metadata.getColumnCount();
      System.out.printf("%s\t%s\t%s\t%s", "ΑΡΙΘΜΟΣ ΓΡΑΜΜΗΣ",
                            "ΟΝΟΜΑ ΓΡΑΜΜΗΣ", "ΧΡΟΝΟΣ ΔΥΙΕΛΕΣΗΣ ΠΡΩΤΟΥ ΔΡΟΜΟΛΟΓΙΟΥ",
                            "ΧΡΟΝΟΣ ΔΙΕΛΕΥΣΗΣ ΤΕΛΕΥΤΑΙΟΥ ΔΡΟΜΟΛΟΓΙΟΥ");
      System.out.println();
  
      while(rs.next()) {
  
          System.out.printf("%s\t%s\t%s\t%s\n", rs.getString("number"), rs.getString("name"),
                           rs.getString("min(Stop_Times.departure_time)"),
                           rs.getString("max(Stop_Times.departure_time") );
  
      }
      rs.close();
      stm.close();
          dbcon.close(); 
  
  } catch (SQLException e) {
          System.out.print("SQLException: ");
          System.out.println(e.getMessage());
  }
  </code></pre>
  
  <p>the problem here is that when i want to display two or more columns, i get this message:</p>
  
  <p>"[Microsoft][ODBC Driver Manager] Invalid string or buffer length exception "</p>
  
  <p>what am i doing wrong?
  thanks in advance!</p>