Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Statement stmt = null;
- try {
- Connection conn_db = DriverManager.getConnection("jdbc:mysql://" + url + "/" + db, user, password);
- stmt = conn_db.createStatement();
- ResultSet res = stmt.executeQuery("select count(*) as cnt from queue where session = '" + (String) params[0] + "'");
- while (res.next()) {
- if (res.getString("CNT").equals("0")) {
- // check if admin
- ResultSet resAdmi = stmt.executeQuery("select u.status from users u join sessions s on s.session_id = '"
- + (String) params[0] + "'" + " and s.user=u.id");
- while (resAdmi.next()) {
- if (!resAdmi.getString("STATUS").equals("20"))
- rejectClient("you passed false...");
- }
- } else {
- // Checking for Widgets uploading ready status!
- int ready = 0;
- ResultSet resRedy = stmt.executeQuery("select ready from queue where session = '" + (String) params[0] + "'");
- while (resRedy.next()) {
- ready = resRedy.getInt("READY");
- }
- log.error("READY is :" + Integer.toString(ready));
- if (ready == 0) {
- log.error("STARTING THE INITIALIZATION OF RECIV DATA =========== NOT YET READY!!!!");
- } else if (ready == 1) {
- log.error("STARTING THE INITIALIZATION OF RECIV DATA");
- IClient client = conn.getClient();
- if (params.length > 0) {
- client.setAttribute("session_id", (String) params[0]);
- if (appScope == conn.getScope())
- ConnectionHolder.getInstance().connect(conn);
- } else
- log.error("No params...");
- }
- }
- }
- stmt.close();
- stmt = null;
- conn_db.close();
- conn_db = null;
- } catch (SQLException ex) {
- log.error("SQLException: " + ex.getMessage());
- log.error("SQLState: " + ex.getSQLState());
- log.error("VendorError: " + ex.getErrorCode());
- }
Add Comment
Please, Sign In to add comment