⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 administratorinterface.java

📁 Java编写的物业管理系统
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
      input=javax.swing.JOptionPane.showInputDialog(f,"请输入Update语句","Input",javax.swing.JOptionPane.QUESTION_MESSAGE);           if((input!=null)&&(input.length()!=0)){             jTextArea4.setText("SQL查询:\n"+input+"\n");              //进行数据更新              try{                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");              }              catch(ClassNotFoundException ce){                    ce.printStackTrace( );                    jTextArea4.append("\n"+ce.toString( )+"\n");                                 }             try{                 Connection con=DriverManager.getConnection("jdbc:odbc:houqin");                 Statement stmt=con.createStatement();                 int status=stmt.executeUpdate(input);                 if(status!=0)                     jTextArea4.append("更新成功\n");                 else                     jTextArea4.append("更新失败\n");                 //ResultSet rs=stmt.executeQuery("select * from shoufei");                 //System.out.println(zc.face.MySqlUnit.printResultSet(rs));                 stmt.close();                 con.close();              }              catch(SQLException e){                     e.printStackTrace( );                     jTextArea4.append("\n"+e.toString( )+"\n");                                  }                  }            else          jTextArea4.setText("输入正确的Update语句.");      // Add your handling code here:  }//GEN-LAST:event_jMenuItem9ActionPerformed  private void jMenuItem19ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem19ActionPerformed      String input=null;      javax.swing.JFrame f=new javax.swing.JFrame();      input=javax.swing.JOptionPane.showInputDialog(f,"请输入sql查询语句","Input",javax.swing.JOptionPane.QUESTION_MESSAGE);      //int returnValue=javax.swing.JOptionPane.CANCEL_OPTION;      System.out.println("数据查询.........");      if((input!=null)&&(input.length()!=0)){              System.out.println(input);              //进行数据库查询              try{                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");              }              catch(ClassNotFoundException ce){                    System.out.println("SQLException:"+ce.getMessage());              }             try{                 Connection con=DriverManager.getConnection("jdbc:odbc:houqin");                 Statement stmt=con.createStatement();                 ResultSet rs=stmt.executeQuery(input);                // System.out.println(zc.face.MySqlUnit.printMetaData(rs));                 System.out.println(zc.face.MySqlUnit.printResultSet(rs));                 stmt.close();                 con.close();              }              catch(SQLException e){                     System.out.println("SQLException:"+e.getMessage());              }             catch(IOException e2){                     System.out.println("IOException:"+e2.getMessage());              }      }                   else           System.out.println("输入正确的sql查询语句.");                      // Add your handling code here:  }//GEN-LAST:event_jMenuItem19ActionPerformed  private void jMenuItem12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem12ActionPerformed      String input=null;      javax.swing.JFrame f=new javax.swing.JFrame();      input=javax.swing.JOptionPane.showInputDialog(f,"请输入Insert语句","Input",javax.swing.JOptionPane.QUESTION_MESSAGE);            if((input!=null)&&(input.length()!=0)){              jTextArea4.setText("SQL查询:\n"+input+"\n");              //进行数据添加              try{                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");              }              catch(ClassNotFoundException ce){                    ce.printStackTrace( );                    jTextArea4.append("\n"+ce.toString( )+"\n");                                 }             try{                 Connection con=DriverManager.getConnection("jdbc:odbc:houqin");                 Statement stmt=con.createStatement();                 int status=stmt.executeUpdate(input);                 if(status!=0)                     jTextArea4.append("插入成功\n");                 else                     jTextArea4.append("插入失败\n");                 //ResultSet rs=stmt.executeQuery("select * from ");                 //System.out.println(zc.face.MySqlUnit.printResultSet(rs));                 stmt.close();                 con.close();              }              catch(SQLException e){                     e.printStackTrace( );                     jTextArea4.append("\n"+e.toString( )+"\n");                                  }                   }            else           jTextArea4.setText("输入正确的Insert语句.");      // Add your handling code here:  }//GEN-LAST:event_jMenuItem12ActionPerformed  private void jMenu1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu1ActionPerformed// Add your handling code here:  }//GEN-LAST:event_jMenu1ActionPerformed  private void jMenu7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu7ActionPerformed// Add your handling code here:  }//GEN-LAST:event_jMenu7ActionPerformed  private void jMenu6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu6ActionPerformed// Add your handling code here:  }//GEN-LAST:event_jMenu6ActionPerformed  private void jMenu3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu3ActionPerformed// Add your handling code here:  }//GEN-LAST:event_jMenu3ActionPerformed  private void jMenuItem13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem13ActionPerformed      String input=null;      javax.swing.JFrame f=new javax.swing.JFrame();      input=javax.swing.JOptionPane.showInputDialog(f,"请输入Update语句","Input",javax.swing.JOptionPane.QUESTION_MESSAGE);            if((input!=null)&&(input.length()!=0)){              jTextArea4.setText("SQL查询:\n"+input+"\n");              //进行数据更新              try{                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");              }              catch(ClassNotFoundException ce){                    ce.printStackTrace( );                    jTextArea4.append("\n"+ce.toString( )+"\n");                                 }             try{                 Connection con=DriverManager.getConnection("jdbc:odbc:houqin");                 Statement stmt=con.createStatement();                 int status=stmt.executeUpdate(input);                 if(status!=0)                     jTextArea4.append("更新成功\n");                 else                     jTextArea4.append("更新失败\n");                 //ResultSet rs=stmt.executeQuery("select * from zhufang");                 //System.out.println(zc.face.MySqlUnit.printResultSet(rs));                 stmt.close();                 con.close();              }              catch(SQLException e){                     e.printStackTrace( );                     jTextArea4.append("\n"+e.toString( )+"\n");                                  }                  }            else          jTextArea4.setText("输入正确的Update语句.");      // Add your handling code here:  }//GEN-LAST:event_jMenuItem13ActionPerformed  private void jMenuItem10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem10ActionPerformed      String input=null;      javax.swing.JFrame f=new javax.swing.JFrame();      input=javax.swing.JOptionPane.showInputDialog(f,"请输入Delete语句","Input",javax.swing.JOptionPane.QUESTION_MESSAGE);      if((input!=null)&&(input.length()!=0)){             jTextArea4.setText("SQL查询:\n"+input+"\n");                           //进行数据删除              try{                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");              }              catch(ClassNotFoundException ce){                  ce.printStackTrace( );                  jTextArea4.append("\n"+ce.toString( )+"\n");                              }             try{                 Connection con=DriverManager.getConnection("jdbc:odbc:houqin");                 Statement stmt=con.createStatement();                 int status=stmt.executeUpdate(input);                 if(status!=0)                     jTextArea4.append("删除成功\n");                 else                     jTextArea4.append("删除失败\n");                 //ResultSet rs=stmt.executeQuery("select * from shoufei");                 //System.out.println(zc.face.MySqlUnit.printResultSet(rs));                 stmt.close();                 con.close();              }              catch(SQLException e){                  e.printStackTrace( );                  jTextArea4.append("\n"+e.toString( )+"\n");                                }                  }            else           jTextArea4.setText("输入正确的Delete语句.");         // Add your handling code here:  }//GEN-LAST:event_jMenuItem10ActionPerformed  private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed      String input=null;      javax.swing.JFrame f=new javax.swing.JFrame();      input=javax.swing.JOptionPane.showInputDialog(f,"请输入Insert语句","Input",javax.swing.JOptionPane.QUESTION_MESSAGE);           if((input!=null)&&(input.length()!=0)){             jTextArea4.setText("SQL查询:\n"+input+"\n");              //进行数据添加              try{                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");              }              catch(ClassNotFoundException ce){                    ce.printStackTrace( );                    jTextArea4.append("\n"+ce.toString( )+"\n");                                  }             try{                 Connection con=DriverManager.getConnection("jdbc:odbc:houqin");                 Statement stmt=con.createStatement();                 int status=stmt.executeUpdate(input);                 if(status!=0)                     jTextArea4.append("插入成功\n");                 else                     jTextArea4.append("插入失败\n");                 //ResultSet rs=stmt.executeQuery("select * from shoufei");                 //System.out.println(zc.face.MySqlUnit.printResultSet(rs));                 stmt.close();                 con.close();              }              catch(SQLException e){                     e.printStackTrace( );                     jTextArea4.append("\n"+e.toString( )+"\n");                                  }                  }            else          jTextArea4.setText("输入正确的Insert语句.");            // Add your handling code here:  }//GEN-LAST:event_jMenuItem8ActionPerformed  private void jMenuItem17ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem17ActionPerformed      String input=null;      javax.swing.JFrame f=new javax.swing.JFrame();      input=javax.swing.JOptionPane.showInputDialog(f,"请输入sql查询语句","Input",javax.swing.JOptionPane.QUESTION_MESSAGE);      //int returnValue=javax.swing.JOptionPane.CANCEL_OPTION;      System.out.println("数据查询.........");      if((input!=null)&&(input.length()!=0)){              System.out.println(input);              //进行数据库查询              try{                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");              }              catch(ClassNotFoundException ce){                    System.out.println("SQLException:"+ce.getMessage());              }             try{                 Connection con=DriverManager.getConnection("jdbc:odbc:houqin");                 Statement stmt=con.createStatement();                 ResultSet rs=stmt.executeQuery(input);                // System.out.println(zc.face.MySqlUnit.printMetaData(rs));                 System.out.println(zc.face.MySqlUnit.printResultSet(rs));                 stmt.close();                 con.close();              }              catch(SQLException e){                     System.out.println("SQLException:"+e.getMessage());              }             catch(IOException e2){                     System.out.println("IOException:"+e2.getMessage());              }      }                   else           System.out.println("输入正确的sql查询语句.");      // Add your handling code here:  }//GEN-LAST:event_jMenuItem17ActionPerformed  private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed      String input=null;      javax.swing.JFrame f=new javax.swing.JFrame();      input=javax.swing.JOptionPane.showInputDialog(f,"请输入Delete语句","Input",javax.swing.JOptionPane.QUESTION_MESSAGE);      if((input!=null)&&(input.length()!=0)){              jTextArea4.setText("SQL查询:\n"+input+"\n");              //进行数据删除              try{                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");              }              catch(ClassNotFoundException ce){                  ce.printStackTrace( );                  jTextArea4.append("\n"+ce.toString( )+"\n");                               }             try{                 Connection con=DriverManager.getConnection("jdbc:odbc:houqin");                 Statement stmt=con.createStatement();                 int status=stmt.executeUpdate(input);                 if(status!=0)                     jTextArea4.append("删除成功\n");                 else                     jTextArea4.append("删除失败\n");                 //ResultSet rs=stmt.executeQuery("select * from fangchan");                 //System.out.println(zc.face.MySqlUnit.printResultSet(rs));                 stmt.close();                 con.close();              }              catch(SQLException e){                     e.printStackTrace( );                     jTextArea4.append("\n"+e.toString( )+"\n");              }                  }            else           jTextArea4.setText("输入正确的Delete语句.");          // Add your handling code here:  }//GEN-LAST:event_jMenuItem7ActionPerformed  private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed      String input=null;      javax.swing.JFrame f=new javax.swing.JFrame();      input=javax.swing.JOptionPane.showInputDialog(f,"请输入Insert语句","Input",javax.swing.JOptionPane.QUESTION_MESSAGE);            if((input!=null)&&(input.length()!=0)){              jTextArea4.setText("SQL查询:\n"+input+"\n");              //进行数据添加              try{                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");              }              catch(ClassNotFoundException ce){                    ce.printStackTrace( );                    jTextArea4.append("\n"+ce.toString( )+"\n");                                 }             try{                 Connection con=DriverManager.getConnection("jdbc:odbc:houqin");                 Statement stmt=con.createStatement();                 int status=stmt.executeUpdate(input);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -