codecamp

删除数据

删除指定id值的数据代码如下

String id="id_xxx";
		Template<Product> template=new ProxyTemplate(Product.class).getInstance();
		try 
		{
			template.delete(id);
		} catch (Exception e) {
			e.printStackTrace();
		}finally
		{
			template.close();
		}

可以看到控制台输出如下

delete from PRODUCT where ID='id_xxx'

如果需要删除多条数据时,则调用deletes方法即可,如下


List<String> idList=new LinkedList();
template.deletes(idList);


添加数据
修改数据
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }