3 Replies Latest reply: Jan 22, 2004 3:17 AM by 807582 RSS

    jdbc  odbc *.dbf

    807582
      Any one know how to connect to a dbf ? Im doing something wrong! any literature on this topic?
        • 1. Re: jdbc  odbc *.dbf
          807582

          Have you
          1) Set up an ODBC data source in the Windows "Data Sources(ODBC)" control panel ?
          2) Connected via the following connection url, eg. if you named your odbc datasource "myDBF",
          the jdbc url should be "jdbc:odbc:myDBF"

          That's the main difference between reading dBase files, and a standard JDBC data source.

          regards,
          Owen




          • 2. Re: jdbc  odbc *.dbf
            807582
            tried that already. it might be my sql statements

            String query = "UPDATE mon_sta SET ZDATE_ENT = 19501111 WHERE ZDATE_ENT = 11111111";

            int result = statement.executeUpdate( query );

            nothing happens when i check for the updates so i thought my connection was wrong!
            • 3. Re: jdbc  odbc *.dbf
              807582

              If you're not getting any SQLExceptions from executeUpdate(), then it worked.
              Check result, it is the number of rows updated.

              Have you actually checked your data ?
              Execute "select * from mon_sta where ZDATE_ENT = 111111111"... see if there's any results.
              If not, then you're trying to update a record that doesn't exist / conform to your where clause.