我注意到一些程序员使用COMMIT
其他使用conn.setAutoCommit(true);
来结束事务或回滚所以使用一个而不是另一个有什么好处?
主要区别在哪里?
conn.setAutoCommit(true);
Run Code Online (Sandbox Code Playgroud)
过度
statement.executeQuery(query);
statement.commit();
Run Code Online (Sandbox Code Playgroud) 我收到一条关于CUBRID数据库的消息,他们说它在性能方面比MySQL好,所以任何人都听说过.
那是对的吗
问候
我创建了一个接收Action的JButton类,JButton类包括击键和鼠标监听器,因此我可以根据需要在多个帧中使用相同的类.
我的问题是:按下键时JButton没有得到焦点,但是它正在执行操作.我需要创建一个新的背景或告诉用户按钮执行操作的东西.
有任何想法吗??
这是我的代码:
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.Action;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.KeyStroke;
import javax.swing.SwingConstants;
import javax.swing.border.LineBorder;
import swtdesigner.SwingResourceManager;
public class IButtonSave extends JButton{
private static final long serialVersionUID = 1L;
private Action action = null;
public IButtonSave() {
super();
setFocusPainted(true);
setFocusable(true);
try {
jbInit();
} catch (Throwable e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
setMargin(new Insets(0, 0, 0, 0));
setBorder(new LineBorder(Color.black, 1, true));
setIconTextGap(0); …
Run Code Online (Sandbox Code Playgroud)