Java code to read excel on Mac - java

I have been trying to read excel using java code but i am not sure what should be the excel path. This is what i am using on mac:
String xPath = "Desktop/ReadData.xls".
I am getting error message "No such file found"
How the path should be given on mac?
Please help guys. Thanks in advance

If the file is in the desktop, then the path must be specified relative to the current user's home directory, like this:
/Users/<user>/Desktop/ReadData.xls
Where <user> is your user name in the Mac. Or alternatively, you can use this shorter form:
~/Desktop/ReadData.xls

Related

Javah Error: Could not find class file for package.name

I am trying to generate C header file for JNI (Linux). I read documentation and questions on javah, but I still get the same error
Error: Could not find class file for 'org.sqlite.core.NativeDB'
I think I have very obvious mistake but I really don't see any... So, I need to generate header file from the NativeDB.class and the path is:
/u/users/maas/user123/sqlite/sqlite-jdbc-3.21.0/target/common-lib/org/sqlite/core/NativeDB.class
I go to the common-lib folder and call javah from the path of:
/u/users/maas/user123/sqlite/sqlite-jdbc-3.21.0/target/common-lib/
The commands I tried:
javah -classpath "/u/users/maas/user123/sqlite/sqlite-jdbc-3.21.0/target/common-lib/org/sqlite/core" org.sqlite.core.NativeDB
javah org.sqlite.core.NativeDB
The error I get:
Error: Could not find class file for 'org.sqlite.core.NativeDB'
I see the NativeDB.class file in the correct directory I mentioned. In the NativeDB.java (which is not in the same folder with NativeDB.class IF it is important) there is a package path:
package org.sqlite.core;
I found the issue (that was really obvious and dumb).
Commands I wrote in the question are correct. I am using USS (UNIX System Services) for Z/OS and ftp for transferring files. I didn't check that I sent .class files via ftp NOT in binary format. And for this reason Java couldn't find the classes because of wrong encoding.
All you need is just turn on the binary mode in the ftp like so:
ftp server.name.com
..login...
bi
mput *class
The bi command enables binary mode. The .class files are expected to be in this format.

How to pass variable file path to SQL*Loader on Linux

I'm creating .csv file and placing it in one location.
String location = "/APPL_TOP2/IMDD/apps/apps_st/appl/xxfin/12.0.0/bin/xe.csv";
Using exact path working fine on Windows but I need it to work on Linux client too.
String location = "$XXFIN_TOP\\12.0.0\\bin\\xe.csv";
If I'm using relevant path on Linux it is not working, showing Error
SQL*Loader-500: Unable to open file(/APPL_TOP2/IMDD/apps/apps_st/appl/xxfin/12.0.0/bin/xe.csv)
SQL*Loader-553: file not found
SQL*Loader-509: System error: No such file or directory
" Client is asking any option to pass relevant path client machine is Linux"
Paths in Linux have slashes which go the other way. So it should be this:
$XXFIN_TOP/12.0.0/bin/xe.csv

How to give local system path in ssh?

I'm trying to insert records from local directory path in SSH but it shows "file not found" because it does not recognize the path. But if I give sft directory then it recognise the path.
This is the code:
Local directory path:
./putmsgE1E2.ksh LPDWA123 ABC.GD.SENDCORRESPONDENCE.BATCH.INPUT XPRESSION.TEST /Users/admin/Desktop/important.txt;
and I tried using c:/Users/admin/Desktop/important.txt
SFT Directory:
./putmsgE1E2.ksh LPDWA123 ABC.GD.SENDCORRESPONDENCE.BATCH.INPUT XPRESSION.TEST /abchome/abc123/1.txt;
I have inputs in the txt file in my local directory; I want to poll that files to the server. Hope someone finds a solution. Thanks.
Use the below command on Linux systems:
scp /path/to/your/local/file remoteUser#some_address:/home/remoteUser/Documents

Where to copy "initialization patameter file" using oracle database?

I'm compltely new in Oracle database now I'm trying to copy a intilization parameter file from this link. But Question is: Where to save init.ora file in which directory?.. please help?
Depends on the OS.
For Unix/Linux, by default it is $ORACLE_HOME/dbs
For Windows,
Default location for spfile in a windows platform is here:
%ORACLE_HOME%\database\spfile%ORACLE_SID%.ora
For a pfile, path is the same:
%ORACLE_HOME%\database\init%ORACLE_SID%.ora
as per oracle flexible architecture we put pfile in
$ORACLE_BASE/admin/database_name/pfile/
and spfile is present in
$ORACLE_HOME/dbs

Why an extra "/.\" in linux path?

Windows Scenario :-
I have a small piece of code which gets me the location of a specific folder in the directory. The code is as given below:
browserPath = this.EnginePath + "\\Chrome_Selenium\\" + "chromedriver.exe";
This gets me the exact path : D:\Engine\Test
I am trying to use the same logic to get the path in linux machine.
The path where the Engine and Chrome Driver is stored in my linux machine (VM) is
/root/Engine/Chrome_Selenium
Now the linux part :-
I am using the following piece of code to get that
browserPath = this.EnginePath + "/Chrome_Selenium/" + "chromedriver";
The path this piece of code fetches is
/root/Engine/.\Chrome_Selenium\chromedriver
Can you please help me understand why the "/.\" is appearing in the path?
I am guessing the reason why ./ is added is because in linux in order to execute a script in the present working directory you need to address it this way: ./script instead of script. Somehow it is attached even in cases where it is not needed (execution in other folder)
As for the main part as Alfe mentioned it does not make any different at the first place.

Categories