Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String query = "select * FROM Table";
- int port = 8080;
- String user = "user";
- String password = "passwd";
- String jdbcAvaticaURL = "jdbc:avatica:remote:url=http://localhost:"+port+";authentication=BASIC;serialization=JSON";
- Connection connection = DriverManager.getConnection(jdbcAvaticaURL, user, password); // ,info);
- executeQuery(connection,query);
- connection.close();
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- request.getParameter("user"); // returns NULL
- Enumeration<String> params = request.getParameterNames(); // Empty Collection
- response.setContentType("application/json;charset=utf-8");
- response.setStatus(HttpServletResponse.SC_OK);
- // DO THINGS
- }
Add Comment
Please, Sign In to add comment