0

I'm trying to use SQLcl in my maven Java project, but I cannot figure out how to use it.

What I have tried so far:

I downloaded the latest SQLcl (sqlcl-19.4.0.354.0937.zip) from oracle. I extracted all the files into a local folder. I then opened the sqlcl-19.4.0.354.0937\sqlcl\lib folder with terminal and ran 'mvn validate'. Maven stated that 'ucp.jar' is missing. I downloaded that jar from oracle downloads and ran it again. This time it 'seemed to run successfully'. I also tried to 'mvn clean install' with same results.

However, I'm unable to find 'dbtools-common.jar', 'dbtools-http.jar' or 'dbtools-sqlcl.jar' files anywhere in my m2 folder. This tutorial was explaining to do it like this. Intellij is unable to import classes like 'ScriptParser' because the dependencies are missing.

What's the correct way to do this?

Hooman.AS
  • 190
  • 1
  • 3
  • 18
W0lfw00ds
  • 2,018
  • 14
  • 23
  • were you able to do it? – P. Waksman Apr 18 '23 at 16:18
  • @P.Waksman It's been few years, but I think I managed to get it to work :-) Those dependencies were a mess to handle. I think I ended up with some missing runtime dependencies. The only way to be sure is to take all dependencies... – W0lfw00ds Apr 26 '23 at 13:05

1 Answers1

0

The pom sqlcl/lib is used for installing dependent jars into your local repository. However, its not for installing the sqlcl jars (dbtools-*) into your local repository. You can certainly tweak it to do so, and use them as @Hooman.AS suggests.

The pom is to load the dependencies for the jdbcrest so that users can try out the rest jdbc driver.

Swaps
  • 1,450
  • 24
  • 31
  • I just want to use the java api to run sql scripts via sqlcl (like in the example code) and nothing else. Is it enough if I just add the dbtools-* jars as dependency? – W0lfw00ds Mar 19 '20 at 19:54