-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IllegalMonitorStateException on connection to Netezza DB #50
Comments
Not sure what is happening here? What version of Java are you using? If you write similar code in Java directly, does it work? |
I have:
I can try figure out similiar java code, but I'm no expert. Could you provide an example java code snippet that I could use as a template? |
This essentially equivalent code works in R on the same machine. library(RJDBC)
drv = JDBC(driverClass = "org.netezza.Driver",
classPath = "C:/JDBC/nzjdbc.jar")
conn = dbConnect(drv, paste0("jdbc:netezza://DCP:5480/db;user=",username,";password=",pwd))
dbListTables(conn)
a = dbGetQuery(conn, "SELECT *
FROM H_OD.HS_CM.HE_ATT
limit 100") |
And which version of Julia? Also, is a Java stack trace printed at all? The trouble is, I do not have access to a netezza database, and even the driver is not freely downloadable. |
Unfortunately no Java stack trace is shown - maybe there's a way to make Java more verbose? julia> versioninfo()
Julia Version 1.2.0
Commit c6da87ff4b (2019-08-20 00:03 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
JULIA_EDITOR = "C:\Users\colin37\AppData\Local\JuliaPro-1.2.0-1\app-1.40.1\atom.exe" -a
JULIA_NUM_THREADS = 4 |
Ah could you please try with Julia 1.0.x? There are some issues with threading and Julia 1.1/1.2 |
Julia 1.0.5 (LTS) works for the above - thanks! |
Testing on Julia 1.3.0, and this is still an issue. Error message seems more informative now? julia> cnxn = JDBC.Connection("jdbc:oracle:thin:@$(hostname):$(port)/$(service_name)", props = Dict("user" => ENV["oracle_user"], "password" => ENV["oracle_pwd"]))
Exception in thread "main" ERROR: JavaCall.JavaCallError("Error calling Java: java.lang.NoClassDefFoundError: Could not initialize class oracle.jdbc.driver.T4CDriverExtension")
Stacktrace:
[1] geterror(::Bool) at C:\Users\username\.julia\packages\JavaCall\Iz2MQ\src\core.jl:294
[2] geterror at C:\Users\username\.julia\packages\JavaCall\Iz2MQ\src\core.jl:274 [inlined]
[3] _jcall(::JavaMetaClass{Symbol("java.sql.DriverManager")}, ::Ptr{Nothing}, ::Ptr{Nothing}, ::Type, ::Tuple{DataType,DataType}, ::String, ::Vararg{Any,N} where N) at C:\Users\username\.julia\packages\JavaCall\Iz2MQ\src\core.jl:247
[4] jcall(::Type{JavaObject{Symbol("java.sql.DriverManager")}}, ::String, ::Type, ::Tuple{DataType,DataType}, ::String, ::Vararg{Any,N} where N) at C:\Users\username\.julia\packages\JavaCall\Iz2MQ\src\core.jl:143
[5] getConnection(::String, ::Dict{String,String}) at C:\Users\username\.julia\packages\JDBC\2ruzk\src\JDBC.jl:23
[6] #Connection#1(::Dict{String,String}, ::String, ::Type{JDBC.Connection}, ::String) at C:\Users\username\.julia\packages\JDBC\2ruzk\src\interface.jl:50
[7] (::Core.var"#kw#Type")(::NamedTuple{(:props,),Tuple{Dict{String,String}}}, ::Type{JDBC.Connection}, ::String) at .\none:0
[8] top-level scope at none:0 |
I guess the question is whether |
I'm trying to extract data from a Netezza database.
I run the following:
I get the following error:
I don't know why this is happening, and can't find clues in the documentation
The text was updated successfully, but these errors were encountered: