Code example for Statement

Methods: executeUpdate, setQueryTimeout

0
 
		Connection connection = null;
		try { 
			connection = DriverManager.getConnection("jdbc:sqlite:" + basePath);
			Statement statement = connection.createStatement();
			statement.setQueryTimeout(30); 
			statement.executeUpdate("DELETE FROM playlist_song "+
						"WHERE id_song="+id_song+
						" AND id_playlist="+idPlaylist);
		}catch (Exception e) {
			e.printStackTrace();
		}finally 
		{ 
			try 
			{ 
				if(connection != null)
					connection.close();
			} 
			catch(SQLException e)
			{ 
				// connection close failed.