-
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 ;
}
}
-
Re: singletons