systemtable.java

来自「这是一本描述JDBC数据库的书籍」· Java 代码 · 共 53 行

JAVA
53
字号
/* * SystemTable.java * * Created on June 9, 2005, 2:41 PM * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */package ch01;import java.sql.*;import javax.sql.*;import common.*;/** * * @author kevin */public class SystemTable {        /** Creates a new instance of SystemTable */    public SystemTable() {    }        public static void main(String[] args){        Connection conn = null;        Statement  stmt = null;        ResultSet  rs   = null;        try{            ConnectionFactory factory =                 ConnectionFactory.getConnectionFactory();            conn = factory.getConnection();                        stmt = conn.createStatement();            rs = stmt.executeQuery("select * from tab");            while(rs.next()){                System.out.println(rs.getString(1));                System.out.println(rs.getString(2));            }        }catch(Exception e){            e.printStackTrace();        }finally{            DBUtils.close(rs, stmt, conn);        }    }    }

⌨️ 快捷键说明

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