Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / February 2005

Tip: Looking for answers? Try searching our database.

Connecting to Clipper dbf files

Thread view: 
Jason Nicodemus - 25 Feb 2005 18:28 GMT
I need to connect to tables were created in Clipper that have extension of
dbf. I have tried the jdbc:odbc bridge but get a no Suitable driver.
Currently we use VB and a Datadirect 4.1 driver. I am sure they is a way to
connect to these kinds of file but I really have no clue. Any help would be
greatly appreciated
Lee Fesperman - 25 Feb 2005 19:10 GMT
> I need to connect to tables were created in Clipper that have extension of
> dbf. I have tried the jdbc:odbc bridge but get a no Suitable driver.
> Currently we use VB and a Datadirect 4.1 driver. I am sure they is a way to
> connect to these kinds of file but I really have no clue. Any help would be
> greatly appreciated

As long as you have a datasource setup with ODBC, there should be no problem. Please
post your code.

Signature

Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS  (http://www.firstsql.com)

Jason Nicodemus - 25 Feb 2005 20:59 GMT
Here is the code I was using.

public dbfReader() {
       Clipper = new org.netbeans.lib.sql.ConnectionSource();
       Clipper.setDatabase("jdbc:odbc:SurgeOn32");
       Clipper.setDriver("sun.jdbc.odbc.JdbcOdbcDriver");
       try {
           Connection conn = DriverManager.getConnection
(Clipper.getDatabase(),"","");
           Statement stmt = conn.createStatement();
           ResultSet rs;
 
           rs = stmt.executeQuery("SELECT P_LNAME FROM PATGEN1 WHERE P_GID
= 0001234");
           while ( rs.next() ) {
               String lastName = rs.getString("P_LNAME");
               System.out.println(lastName);
           }
            conn.close();
       } catch (Exception e) {
           System.err.println("Got an exception! ");
           System.err.println(e.getMessage());
       }

   }
   
}
Lee Fesperman - 25 Feb 2005 23:20 GMT
> Here is the code I was using.
>
[quoted text clipped - 5 lines]
>             Connection conn = DriverManager.getConnection
> (Clipper.getDatabase(),"","");

I don't know what setDriver() is doing, but you need to register the driver. That's what
the exception indicates. Perhaps, something like this is what is needed:

   Class.forName(Clipper.getDriver()); // will register the driver
   Connection conn = ....

Signature

Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS  (http://www.firstsql.com)



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.