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

📄 debug_4.java

📁 程序练习中包括书中实例程序代码和练习中要用到的代码,是压缩文件
💻 JAVA
字号:
package questions.c17;
import java.sql.*;
import java.util.*;
public class Debug_4 {
   public static void main( String [] args ) {
      try {
         Class.forName( "COM.ibm.db2.jdbc.app.DB2Driver" );
 	 Connection con = DriverManager.getConnection(
            "jdbc:DB2:SAMPLE" );
         String sql = "SELECT FIRSTNME,LASTNAME FROM " +
            "PAULAL.EMPLOYEE WHERE JOB = 'DESIGNER'"; 
         Statement s = con.createStatement();
         ResultSet rs = s.executeQuery( sql );
         System.out.println( " The designers are: " );
         while ( rs.next() ) { 
            String output = rs.getString( 1 ).trim();
            output += ", " + rs.getString( "LASTNAME" );
            System.out.println( output );
         }
         rs.close();
         s.close();
         con.close();
      } catch( Exception e ) {
         System.out.println( e.getMessage() );
         e.printStackTrace();
      } finally {
         System.out.println( 
            "There should be no exceptions." );
      }
      
   }
}

⌨️ 快捷键说明

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