📄 testdbffile.java
字号:
/* * * Test the dbfFileDriver * * Copyright 1996 John Wiley & Sons, Inc. All Rights Reserved. Reproduction * or translation of this work beyond that permitted in Section 117 of the 1976 * United States Copyright Act without the express written permission of the * copyright owner is unlawful. Requests for further information should be * addressed to Permissions Department, John Wiley & Sons, Inc. The * purchaser may make back-up copies for his/her own use only and not for * distribution or resale. The Publisher assumes no responsibility for errors, * omissions, or damages, caused by the use of this software or from the use * of the information contained herein. * */import java.net.URL;import java.sql.*;class testDbfFile { public static void main(String argv[]) { // Uncomment the next line to get noisy messages // during the test // // java.sql.DriverManager.setLogStream(System.out); try { // load the driver // Class.forName("dbfFileDriver"); // the url to the tinySQL data source // String url = "jdbc:dbfFile:."; // get the connection // Connection con = DriverManager.getConnection(url, "", ""); // create a statement and execute a query // Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT LAST_NAME FROM people"); // fetch each row // while (rs.next()) { // get the column, and see if it matches our expectations // String colval = rs.getString(1); System.out.println("LAST_NAME = " + colval); } stmt.close(); con.close(); } catch( Exception e ) { System.out.println(e.getMessage()); e.printStackTrace(); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -