Unable to locate jar file in DB2 Command prompt - jar

I am trying to create a User Defined Functions in IBM data studio, I am following the steps at this Link.
I did not have any problem until the step where I have to Register the jar file with DB2 by entering:
db2 "CALL sqlj.install_jar('C:\Program Files\IBM\SQLLIB\java\jdk
\bin\udftest.jar','UDFTESTJAR')"
Into DB2 Command Prompt. However it shows the following error:
SQL20200N The install or replace of "BELSIZE .UDFTESTJAR" failed as
"C:\Program Files\IBM\SQLLIB\java\jdk\bin\udftest.j" could not be
located. SQLSTATE=46001
I have check through the location of udftest.jar, I am sure that the location path was correct. May I know what is wrong with me command line? Thanks in advance!

After looking true the website link again, I have forgotten to add file: at the path.
db2 "CALL sqlj.install_jar('file:C:\Program Files\IBM\SQLLIB\java\jdk
\bin\udftest.jar','UDFTESTJAR')"

Related

Vscode-R; permission denied to access request.log file

I am learning R and followed the instructions to program R using Visual Studio Code. I then tried to run the following line of code to learn how to read data.
dat <- read.table("d.data")
View(dat)
where d.data is a data file. I received the following error:
cannot open file '...\.vscode-R/request.log': Permission denied.
I tried using the "Give Access To" command from right-clicking the file in File Explorer, however, I don't think it did anything. How do I grant the program/terminal permission to open the file? It may be significant to note that running the same commands using the radian console works without any issues (I get the data outputted in a separate window).
I found a workaround for this issue by adjusting these settings in VSCode:
"r.alwaysUseActiveTerminal": true,
"r.bracketedPaste": true,
Then, by calling radian in an opened cmd terminal, I was able to load everything without any issues

Flyway: unable to load custom config file in cmd line

I created a new config file called "compare.conf" & placed it in 'conf' folder.
When I run the below command, I get the following error:
PS C:\Projects\Learning\Test\flyway-3.2.1> .\flyway -configFile=conf\compare.conf info
Flyway 3.2.1 by Boxfuse
ERROR: Unable to load config file: C:\Projects\Learning\Test\flyway-3.2.1\conf\compare
If I run the same command with absolute URL like below, it works fine. Is this a known issue in Flyway?
PS C:\Projects\Learning\Test\flyway-3.2.1> .\flyway -configFile=C:\Projects\Learning\Test\flyway-3.2.1\conf\compare.conf info
Use System property switch -Dflyway.configFile=xxx.properties instead of command line switch -configFile=xxx.properties

Opentripplanner Graph.obj file not found error

Trying to run the opentripplanner and using the Graph.obj to run it for a country.
But whenever trying to run the server it is giving the filenotfound exception at location /otp/Graph.obj although i have put the Graph.obj in the same location.
Stacktrace while running the server is :
Graph file not found or not openable for routerId '' under file:/otp
java.io.FileNotFoundException: /otp/Graph.obj (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:146)
at java.io.FileInputStream.(FileInputStream.java:101)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
I had the same problem trying to run OTP.
First problem: the routerId is missing
Second problem: the default directory is /var/otp/graph and OTP seems to search the graph under /var/otp/graph/{routerId}
Third problem (may not be yours): I tried to run OTP in Cygwin (Windows) and probably there was some trouble with the slashes/backslashes, so I decided to copy the graph under a "../gtfs/gurgaon"
Solution:
Step 1) create a subdirectory like "/var/otp/graph/gurgaon" and copied Graph.obj over there
Step 2) run something like: $ java -jar target/otp.jar --router gurgaon --graphs ../gtfs --server
It worked like a charm for me!
Try this code: java -Xmx5G -jar target/otp-0.20.0-SNAPSHOT-shaded.jar --build path your gtfs and osm.pbf files --inMemory
It worked perfect for me.

R script from command line

I wanted to run this example script: http://mazamascience.com/WorkingWithData/?p=912 from Windows command line. So I opened the command line and typed Rscript tryCatch.R 1. However, I keep getting the error message Error: R not found. I did set the PATH environment variable as C:\Programme\R\R-3.0.1\bin. If I just type R.exe, it does start R, but it cannot find the packages that are to be loaded at start (e.g. package 'utils' in options<"defaultPackages"> was not found). I guess I have to set another path to the libraries somewhere, but I haven't got any idea where to do this.
UPDATE: After explicitly typing PATH C:\Programme\R\R-3.0.1\bin (rather than just adding this to the value of the environment variable PATH) it seems that R is found. However, a new problem occurs: In normalizePath<path.expand(path), winslash, mustWork>: path[2] = "C:/Programme/R/R-3.0.1/library": Access denied, the same than for the methods library. Then: Calls: .First ... library -> .getRequiredPackages2 -> library -> normalizePath Execution stopped. I'm using Windows 7 and I do have administrator rights.
Rscript is very handy (R CMD BATCH is the old way to ) specially under windows, But generally under I create a batch file to avoid all path's headache.
For example say launcher.bat:
#echo off
C:
PATH C:\Programme\R\R-3.0.1\bin;%path%
cd PATH_TO_YOUR_RSCRIPT
Rscript tryCatch.R 1
pause
And open a console(using cmd) , go where you have stored your launcher.bat and launch it. Or from the R cosnole using shell:
shell('path_to_launcher\launcher.bat')
I've found out that it was a language-specific problem on Windows 7, similar to what is described here: https://stat.ethz.ch/pipermail/r-help/2011-May/276932.html
After changing PATH to C:\Program Files\R\R-3.0.1\bin the script is properly executed from the command prompt.
Thanks to everyone who tried to help!
I ran into this problem under windows 7, apparently, when setting environment variables>user variables the path is not added into the PATH, so the user must add this path in system variables > PATH
at the end just add the path to your .EXE files and voila.

How can i use DBLinq >> DBMetal tool with sqlite?

Please provide samples of command line tool dbmetal to generate code file from a sqlite database.
Surfing the internet I found the following command:
DBMetal.exe /namespace:Namespace /provider:SQLite "/conn:Data Source=database.db" /code:CodeFile.cs
Only, the DBMetal version that I downloaded gave an error (Unable to resolve databaseConnectionType: System.Data.SQLite.SQLiteConnection)
I fixed it by downloading the code from the trunk (http://dblinq2007.googlecode.com/svn/trunk), compiling it, and using the generated DBMetal.exe with the above command.

Resources