KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ Using jdbc.jar causes Error: s.k. OS reports: No such file or directory

  • Using jdbc.jar causes Error: s.k. OS reports: No such file or directory

    Posted by fuzzychaos on September 23, 2023 at 12:00 am

    I’m trying to connect to a 4.5 KX Platform RDB process on a remote server with the jdbc.jar using SQuirreL SQL Client or NiFi 1.23.2 with the DBCP service or using the Example1.java from the Github page but all fail to work with the following error:

    Error: s.k. OS reports: No such file or directory

    My connect string is jdbc:q:myservername:5007 and class is jdbc.  The connection test passes and I can list tables in SQuirreL but am unable to make the most basic select statement work with any of the 3 options above.

    What can I check or what am I missing?

    fuzzychaos replied 8 months, 2 weeks ago 1 Member · 1 Reply
  • 1 Reply
  • fuzzychaos

    Member
    September 23, 2023 at 12:00 am

    Ok I figured out that the ps.k file from the qodbc3.zip was not loaded in the q process per https://code.kx.com/q/interfaces/q-server-for-odbc3/ but even though there is no permission issue with the file it reports “no such file or directory” on trying to load it from the running process.  The command that I run from ScratchPad while connected to the q process is: l /mypath/ps.k

    Edit 1: it helps to use the correct server when doing the load.  So, I was able to load the ps.k file and get the connection to work for SQuirreL and the example Java program.  I need to continue troubleshooting NiFi as that is giving me an error:

    ExecuteSQL[id=9a500a9f-0189-1000-ffff-ffffb8a8d93d] Unable to execute SQL select query [select * from company]. No FlowFile to route to failure: org.apache.nifi.processor.exception.ProcessException: java.lang.IllegalArgumentException: createSchema: Unknown SQL type 0 /  (table: NiFi_ExecuteSQL_Record, column: time) cannot be converted to Avro type - Caused by: java.lang.IllegalArgumentException: createSchema: Unknown SQL type 0 /  (table: NiFi_ExecuteSQL_Record, column: time) cannot be converted to Avro type

    Edit 2: The “SQL select query” entry had to have a cast added in the NiFi ExecuteSQL processor like this (cast each unrecognized column to the correct type, text in my case):

    select unit,category,cast(name as text) from categoryUnits

    Now everything is working as it should.

Log in to reply.