public static boolean validate(String user, String password) { Connection con = null; PreparedStatement ps = null; try { con = DataConnect.getConnection(); ps = con.prepareStatement( "Select uname, password from Users where uname = ? and password = ?"); ps.setString(1, user); ps.setString(2, password); ResultSet rs = ps.executeQuery(); if (rs.next()) { // result found, means valid inputs return true; } } catch (SQLException ex) { System.out.println("Login error -->" + ex.getMessage()); return false; } finally { DataConnect.close(con); } return false; }
private void drag(WebPlotView pv, ScreenPt spt) { WebPlot plot = pv.getPrimaryPlot(); _mouseInfo.setEnableAllPersistent(true); _mouseInfo.setEnableAllExclusive(false); _currentPt = plot.getImageWorkSpaceCoords(spt); _dataConnect.setData(makeSelectedObj(plot)); _drawMan.redraw(); }
private void disableSelection() { switch (_mode) { case SELECT: releaseMouse(); break; case EDIT: releaseMouse(); break; case OFF: // do nothing break; default: WebAssert.argTst(false, "only support for SelectType of SELECT or EDIT"); break; } removeAttribute(); _dataConnect.setData(null); if (_drawMan != null) { clearPlotViews(); } }
private void removeDrawMan() { _drawMan.clear(); _dataConnect.setData(null); }