Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int zZ = 1;
- PoolConnection pconp = ConnectionPool.getConnection();
- PreparedStatement psp = null;
- try {
- Connection conp = pconp.connect();
- psp = conp.prepareStatement("SELECT count(name) as summe FROM `userteams` where `name` = ?");
- psp.setString(1, target.getName());
- ResultSet rsp = psp.executeQuery();
- while(rsp.next()) {
- if(rsp.getInt("summe") >= 1) {
- whois.append(String.format("#_Teams_: °%%15°"));
- PoolConnection pcon3 = ConnectionPool.getConnection();
- PreparedStatement ps3 = null;
- try {
- Connection con3 = pcon3.connect();
- ps3 = con3.prepareStatement("SELECT * FROM `userteams` where name = ?");
- ps3.setString(1, target.getName());
- ResultSet rs3 = ps3.executeQuery();
- while(rs3.next()) {
- PoolConnection pcon2 = ConnectionPool.getConnection();
- PreparedStatement ps2 = null;
- try {
- Connection con2 = pcon2.connect();
- ps2 = con2.prepareStatement("SELECT * FROM `teams` where id = ? order by team");
- ps2.setString(1, rs3.getString("team"));
- ResultSet rs2 = ps2.executeQuery();
- while(rs2.next()) {
- whois.append((zZ != 1 ? ", " : "")).append("°>_h").append(rs2.getString("team"));
- if(rs3.getInt("tl") == 1) {
- whois.append(" (Teamleitung)");
- }
- whois.append("|/h ").append(rs2.getString("team")).append("-team<°");
- zZ++;
- }
- whois.append(String.format("°%%00°"));
- } catch (SQLException e) {
- e.printStackTrace();
- } finally {
- if (ps2 != null) {
- try {
- ps2.close();
- } catch (SQLException e) {
- }
- }
- pcon2.close();
- }
- }
- } catch (SQLException e) {
- e.printStackTrace();
- } finally {
- if (ps3 != null) {
- try {
- ps3.close();
- } catch (SQLException e) {
- }
- }
- pcon3.close();
- }
- }
- }
- } catch (SQLException e) {
- e.printStackTrace();
- } finally {
- if (psp != null) {
- try {
- psp.close();
- } catch (SQLException e) {
- }
- }
- pconp.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement