mallett76 has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to install DBD::JDBC on my windows computer. Per the site it says to run the server.
So, I ran the following command, from the windows command prompt:
java -cp "dbd_jdbc.jar:log4j-api-2.17.1.jar:log4j-core-2.17.1.jar:." - +Dlog4j2.disableJmx=true -Ddbd.port=12345 com.vizdom.dbd.jdbc.Server
It it said it could not load or find main class com.vizdom.dbd.jdbc.Server - so, where is this com.vizdom.dbd.jdbc.Server class supposed to be? Is it something I need to add to my classpath?
Also, the command line that I referenced, came from the following file C:\Strawberry\cpan\build\DBD-JDBC-0.72-0\server\sample-command-line.txt
On the CPAN site DBD::JDBC they make note to run the server, one would need to enter the following command line:
export CLASSPATH=dbd_jdbc.jar:log4j-1.2.13.jar:.:/oracle/jdbc/classes1 +11.zip:$CLASSPATH DRIVERS=oracle.jdbc.driver.OracleDriver java -Djdbc.drivers=$DRIVERS -Ddbd.port=9001 com.vizdom.dbd.jdbc.Serve +r
But, it is written in bash. But, the problem is, Bash is a Unix shell - and I'm running windows. So, what would the equivalent be for windows?

Any assistance would be appreciated.

Replies are listed 'Best First'.
Re: Trying to connect to DBD::JDBC - com.vizdom.dbd.jdbc.Server
by marto (Cardinal) on Jul 25, 2023 at 17:38 UTC

      From bash, I ran the following:

      java -Djdbc.drivers=$DRIVERS -Ddbd.port=9001 com.vizdom.dbd.jdbc.Serve +r^Zexport CLASSPATH=dbd_jdbc.jar:/oracle/jdbc/classes111.zip:$CLASSPA +TH DRIVERS=oracle.jdbc.driver.OracleDriver java -Djdbc.drivers=$DRI +VERS -Ddbd.port=9001 -Ddbd.trace=tedious com.vizdom.dbd.jdbc.Server

      and I received the following error:

      Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/ +logging/log4j/LogManager at com.vizdom.dbd.jdbc.Server.<clinit>(Server.java:70) Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j. +LogManager at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass( +BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.l +oadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java: +520)

      So, that would lead me to believe that the environment variables, are not set up properly. However, My environment variables point to the C:\jars folder. And, in this folder, I have the following files: dbd_jdbc.jar, log4j2.properties, tdgssconfig.jar, and log4j-1.2.13.jar - so, am I missing a file?

      Here is my class path:

      C:\Users\pMalle001>echo %CLASSPATH%. .;C:\jars\*;C:\Program Files\Teradata\Client\16.20\bin\;C:\Program Fil +es\Teradata\Client\16.20\bin\tdgeospatial.jar;C:\Program Files (x86)\ +Teradata\Client\16.20\bin\;C:\Program Files (x86)\Teradata\Client\16. +20\bin\tdgeospatial.jar;C:\Program Files\Teradata\Client\16.20\bin\;C +:\Program Files\Teradata\Client\16.20\bin\jmsam.jar;C:\Program Files +(x86)\Teradata\Client\16.20\bin\;C:\Program Files (x86)\Teradata\Clie +nt\16.20\bin\jmsam.jar;C:\Users\pMalle001\Downloads\trino-jdbc-362.ja +r;.

      Here is my path:

      C:\Users\pMalle001>echo %PATH% C:\Program Files\Teradata\Client\16.20\bin;C:\Program Files (x86)\Tera +data\Client\16.20\bin;C:\Program Files (x86)\Teradata\Client\16.10\bi +n;C:\Program Files\Java\jdk-17\bin;C:\Program Files\Common Files\Orac +le\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\java +path;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\pe +rl\bin;C:\Users\pMalle001\AppData\Local\Programs\Python\Python311\;C: +\Oracle\product\11.2.0\client_1\64Bit;C:\Oracle\product\11.2.0\client +_1;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows +\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Pro +gram Files (x86)\Symantec\VIP Access Client\;C:\Program Files (x86)\W +inSCP\;C:\Program Files (x86)\GnuPG\bin;C:\Program Files\nodejs\;C:\P +rogramData\chocolatey\bin;C:\Program Files\Microsoft SQL Server\Clien +t SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Serve +r\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Bin +n\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Fil +es (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Azure Da +ta Studio\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C +:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program F +iles (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\ +Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft S +QL Server\140\DTS\Binn\;C:\Work\Programming\sharepointDrive\powerShel +l\PSTools;C:\Program Files\Git\cmd;C:\Users\pMalle001\AppData\Local\P +rograms\Python\Python311\Scripts\;C:\Users\pMalle001\AppData\Local\Pr +ograms\Python\Python311\;C:\Users\pMalle001\AppData\Local\Microsoft\W +indowsApps;C:\Users\pMalle001\AppData\Roaming\npm;C:\Program Files\Az +ure Data Studio\bin;C:\Users\pMalle001\AppData\Local\GitHubDesktop\bi +n

      Any thoughts or ideas as to where I'm going wrong would be appreciated.