Results 1 to 2 of 2

Thread: singletons

  1. #1
    issepower is offline Member
    Join Date
    Nov 2011
    Posts
    1
    Rep Power
    0

    Default singletons

    How do i put this static method into singleton ? (sorry for bad english)

    public static int verwijderUser (final String gebruiker) throws SQLException, ConException
    {
    Connection con = Connectie.getConnection () ;
    PreparedStatement statement = null ;
    int result = 0 ;

    try
    {
    statement = con.prepareStatement ("DELETE FROM User WHERE gebruiker = ?") ;
    statement.setString(1, gebruiker) ;

    result = statement.executeUpdate();
    }
    catch (SQLException s)
    {
    System.out.println (s.getMessage()) ;
    }
    finally
    {
    if (statement != null) {statement.close() ;}
    return result ;
    }

    }

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,785
    Rep Power
    7

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •