Guest User

Untitled

a guest
Jun 21st, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. String query = "select * FROM Table";
  2. int port = 8080;
  3. String user = "user";
  4. String password = "passwd";
  5. String jdbcAvaticaURL = "jdbc:avatica:remote:url=http://localhost:"+port+";authentication=BASIC;serialization=JSON";
  6. Connection connection = DriverManager.getConnection(jdbcAvaticaURL, user, password); // ,info);
  7.  
  8. executeQuery(connection,query);
  9.  
  10. connection.close();
  11.  
  12. @Override
  13. protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  14. request.getParameter("user"); // returns NULL
  15. Enumeration<String> params = request.getParameterNames(); // Empty Collection
  16. response.setContentType("application/json;charset=utf-8");
  17. response.setStatus(HttpServletResponse.SC_OK);
  18. // DO THINGS
  19. }
Add Comment
Please, Sign In to add comment