📄 debug_4.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 + -