📄 commonajdbc.java~2~
字号:
package xiangmu;
import java.awt.*;
import java.sql.Connection;
import java.sql.DriverManager;
import javax.swing.*;
import java.sql.ResultSet;
import java.sql.PreparedStatement;
/**
* <p>Title: 第四学习小组-教学管理系统</p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2008</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class CommonaJdbc extends JFrame {
BorderLayout borderLayout1 = new BorderLayout();
public CommonaJdbc() {
try {
jbInit();
/*try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:xiangmu");
PreparedStatement pre=con.prepareStatement("select UserType,UserName from go where UserName = ?");
con.setString(1, this.txtid.getText());
ResultSet re=pre.executeQuery();
if (re.next()) {
if (UserType.equals("系统管理员")) {
this.btnclassadd.setEnabled(true);
this.btnclassselect.setEnabled(true);
this.btnremarkadd.setEnabled(true);
this.btnremarkselect.setEnabled(true);
this.btnstuadd.setEnabled(true);
this.btnstuselect.setEnabled(true);
this.trmod.setEnabled(true);
this.btnallselect.setEnabled(true);
this.btnexit.setEnabled(true);
this.btnzhuxiao.setEnabled(true);
}
if (type.equals("普通用户")) {
this.btnstuadd.setEnabled(false);
this.btnclassadd.setEnabled(false);
this.btnremarkadd.setEnabled(false);
this.btnclassselect.setEnabled(true);
this.btnremarkselect.setEnabled(true);
this.btnstuselect.setEnabled(true);
this.btnallselect.setEnabled(true);
}
}
} catch (Exception ex) {
}*/
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
getContentPane().setLayout(borderLayout1);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -