之前在[mysql]MySQLdb中的事务处理中用autocommit和commit()以及rollback()实现了事务处理. 但后来,用同样的代码在另一个数据库中运行却失败了.找了一个下午的原因.后来发现是MyISAM存储引擎不支持事务导致的.而之前的表用的是InnoDB,支持事务. 显示当前autocommit值: show VARIABLES like '%autocommit%'; 设置autocommit为False ; 查看数据库db_test的表table_test使用的存储引擎
public class PostTextView extends TextView { private Handler handler = new Handler(Looper.getMainLooper()); public PostTextView(Context context) { super(context); } public PostTextView(Context context, AttributeSet attrs) { super(context, attrs); } p
public class TEST { public static void main(String[] args) { int [] oldArr= {1,3,4,5,0,0,6,6,0,5,4,7,6,7,0,5}; int [] newArr= new int[oldArr.length] ; int n=0; for (int i=0;i<oldArr.length;i++) { if(oldArr[i]==0) {} else { newArr[n]=oldArr[i]; n++; }