Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

JDBC Internal Error

Featured Replies

Hi!

I am using jdbc to get data out from Filemaker in a "batch" kind of way, many SELECTS in a row. It workes fine until about 200 of my 1000 things to is done. Then I get:

SequeLink An Internal Error has occured. What is this and how can I fix it?

Its the same questions to the database over and over so If it can do 200 it must surely manage 1000?

Can anyone help me plz!!

  • 1 month later...

That's poor driver code... anyhow...

Use the ODBC Catalog/JDBC Meta Data functions to get the list of tables/columns. See pages 43-44 of the ODBC Driver documentation PDF that comes with FileMaker Pro.

If you checked the values you were about to use against the results of gettables you could error out in your program instead of crashing the server.

I've updated my ADO/ODBC wrapper to provide some functionality for testing the Catalog by using ADOX (another MSFT COM/Win32OLE Database wrapper).

So, assuming you put the attachment ADOWrap.txt as ADOWrap.rb in your directory you can get at the FileMaker ODBC Catalog as such:


require 'ADOWrap.rb'

$strConn = 'DSN=Filemaker;UID=ODBCUser;Pwd=ODBCUser;'



connection = ADOWrap.new($strConn)



# sample of using ADOX / to query the ODBC Catalog

anarray =  connection.tablenames

anarray.each do |table|

  ahash = connection.columnnames(table)

  

  next unless (table == 'tDockets')

  p table

  

  ahash.keys.each do |k|

    p k, ahash[k]

  end

  

  print "-----n"

    

end







Note, that EACH table occurrence will show up in the list of tables... also FileMaker must be open for this query to work.



You'll get output along these lines:





"tDockets"

"StatusText"

{:type=>:adLongVarChar, :datatypeenum=>201}

"zCreatedTime"

{:type=>:adDBTimeStamp, :datatypeenum=>135}

"UnreviewedDisc"

{:type=>:adDouble, :datatypeenum=>5}

"date_IssueAward"

{:type=>:adDBDate, :datatypeenum=>133}

"----- Main Fields"

{:type=>:adDouble, :datatypeenum=>5}

"date_Filed_Number"

{:type=>:adLongVarChar, :datatypeenum=>201}

"date_Filed"

{:type=>:adDBDate, :datatypeenum=>133}





Couple of observations, the field names are not nicely sorted and again this is just to give an example of how you could work with the data structures you can get out of FileMaker.



The relevant ADOX API usage to get at the SQLTables/SQLColumns catalog data is in ADOWrap and looks like this:





  # Returns a list of table names in the current connection

  def tablenames()

    cat = WIN32OLE.new('ADOX.Catalog')

    cat.ActiveConnection = @adocn

    

    tcount = cat.Tables.Count

    returnarray = Array.new()

    for i in 0..(tcount-1) do

      table = cat.Tables(i)

      returnarray << table.Name

    end

    cat = nil

    

    return returnarray



  end



  # Returns a hash of column names and column types for the passed table

  def columnnames(tablename)

      cat = WIN32OLE.new('ADOX.Catalog')

      cat.ActiveConnection = @adocn

      

      begin

        table = cat.Tables(tablename)

      rescue

        cat = nil

        return nil

      end

    

      ccount = table.Columns.Count

      returnhash = Hash.new()

      

      for i in 0..(ccount-1) do

        returnhash[table.Columns(i).Name] = Hash.new()

        returnhash[table.Columns(i).Name][:datatypeenum] = table.Columns(i).Type

        returnhash[table.Columns(i).Name][:type] = $DataTypeEnum[table.Columns(i).Type]

      end

      

      return returnhash

  end

ADOWrap.txt

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.