Results 1 to 2 of 2
Thread: connecting to a foxpro table
- 05-02-2010, 06:22 AM #1
Member
- Join Date
- May 2010
- Posts
- 1
- Rep Power
- 0
connecting to a foxpro table
Hello I have this code and it has a runtime error of run:
java.lang.ClassNotFoundException: com.jstels.dbfdriver
at java.net.URLClassLoader$1.run(URLClassLoader.java: 202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 48)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at Main.main(Main.java:30)
BUILD SUCCESSFUL (total time: 0 seconds)
Java Code:/* * To change this template, choose Tools | Templates * and open the template in the editor. */ //import com.jstels.dbfdriver; import java.sql.*; /** * * @author Lee */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { String databaseurl = "jdbc:jstels:dbf:" + "C:\\java\\com\\HISTORY_POS_TRXNS\\2010_POINT_OF_SALE_TRXNS.dbf"; try { [B][U]Class.forName("com.jstels.dbfdriver"); // OFFENDING STATEMENT[/U][/B] Connection conn = DriverManager.getConnection(databaseurl); Statement stmt = conn.createStatement(); // execute a query ResultSet rs = stmt.executeQuery("SELECT * FROM \"2010_POINT_OF_SALE_TRXNS.dbf\""); // read the data and put it to the console for (int j = 1; j <= rs.getMetaData().getColumnCount(); j++) { System.out.print(rs.getMetaData().getColumnName(j) + "\t"); } System.out.println(); while (rs.next()) { for (int j = 1; j <= rs.getMetaData().getColumnCount(); j++) { System.out.print(rs.getObject(j) + "\t"); } System.out.println(); } // close the objects rs.close(); stmt.close(); conn.close(); } catch (Exception e) { e.printStackTrace(); } } }
- 05-02-2010, 08:39 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
error while connecting
By jyothi_tallapaneni in forum NetworkingReplies: 0Last Post: 04-15-2010, 08:01 AM -
How to repaint.refresh the table (table model) with combo box selection envent
By man4ish in forum AWT / SwingReplies: 1Last Post: 01-08-2010, 06:19 AM -
Connecting jsp.net with Oracle.
By crxuz in forum JDBCReplies: 0Last Post: 07-08-2009, 10:17 AM -
Help connecting
By xcallmejudasx in forum JDBCReplies: 3Last Post: 04-16-2009, 07:09 PM -
Connecting to DB from Applet
By ibanez270dx in forum New To JavaReplies: 1Last Post: 11-13-2007, 11:51 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks