Advertisement
Guest User

Untitled

a guest
Oct 7th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. public static void main(String[] args) throws Exception {
  2. Connection connection = getMySqlConnection();
  3. CallableStatement proc = connection.prepareCall("{ call LCD_GetDispInfoAllTimeTable() }");
  4. proc.registerOutParameter(1, Types.INTEGER);
  5. proc.execute();
  6. int returnValue = proc.getInt(1);
  7. System.out.println(returnValue + "");
  8. // conn.close();
  9. }
  10.  
  11.  
  12. public static Connection getMySqlConnection() throws Exception {
  13. String driver = "com.mysql.jdbc.Driver";
  14. String url = "";
  15. String username = "";
  16. String password = "";
  17.  
  18. Class.forName(driver);
  19. Connection conn = DriverManager.getConnection(url, username, password);
  20. return conn;
  21. }
  22. }
  23.  
  24. Niemstów 07 pętla 10 05:33:00 3673114 11558169 754378 1
  25. NŻ Niemstów 05 16 05:35:00 3669905 11556510 754379 3
  26. NŻ Niemstów 03 16 05:37:00 3666969 11555665 754380 3
  27.  
  28. CREATE DEFINER=`root`@`%` PROCEDURE `LCD_GetDispInfoAllTimeTable`()
  29. BEGIN
  30.  
  31. SELECT bs.name as bsName, tt.busstoptype as bsType, tt.time as ttTime, bs.longitude as lon, bs.latitude as lat, tt.timetable_id as ttID,
  32. Bus_Stop_Status_GET( tt.timetable_id, bst.timetable_id, bst.busstate_id ) as bus_stop_status -- 0 zrobiony, 1 - aktualny, 2- pomiędzy, 3 następne
  33. FROM (SELECT * FROM mpk_currentbusstate ORDER BY changestime desc LIMIT 1 )bst
  34. join mpk_timetable t ON( bst.timetable_id = t.timetable_id )
  35. join mpk_timetable tt ON ( t.linelogin_id = tt.linelogin_id AND t.line_id = tt.line_id AND t.brigade = tt.brigade AND t.rate = tt.rate
  36. and t.schedudle_id = tt.schedudle_id)
  37. LEFT JOIN mpk_busstop bs ON (bs.busstop_id = tt.busstop_id)
  38. LEFT JOIN mpk_busstate bt ON( bst.busstate_id = bt.busstate_id );
  39.  
  40. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement