Erik Deveza

Greenhorn
+ Follow
since Feb 21, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Erik Deveza

After double checking my config file, hibernate.dialect was set to "org.hibernate.dialect.HSQLDialect".
Hi,

I am using javax.persistence.EntityManager to query my table. My query.getResultList() works perfectly when using setFirstResult method, but when I use setMaxResults method, it produces the following error:



When I checked the actual query the limit keyword is placed right after the SELECT keyword, it should be after the statement. Why is the entityManager producing incorrect statement? I am currently using MySQLDialect. I also tried MySQLMyISAMDialect and MySQLInnoDBDialect, but it didn't work as well.

Any input is highly regarded.
Hi, I am currently working on Netbeans IDE to create an IReport plugin. I am having problems importing an external jar file library. In Eclipse IDE, it's very simple and easy, I can just add it in the classpath through properties dialogbox. Does anybody know how to add an external jar file library? I am trying to add a jar file which exports Excel files, Apache POI jar file. Any input is highly appreciated.

Ernie Mcracken wrote:Are you sure $BASHPID is really what you want, this gives your the process ID of the current shell. Maybe you want $UID the current user id?

Also $BASHPID is just a system variable so you can't "execute" it just get its value



Thanks Ernie for dropping your comment! $UID is the current user id? I was hoping to get the user's session id. I was just thinking of this scenario: If there are 2 users using the same username and logs in from 2 remote machines to a separate Linux machine, their session user id will be their identifier because both would only return a single $UID. Would you happen to know how to get the user's session id?
13 years ago

Henry Wong wrote:
I don't see the value of this code... you are starting a new shell (bash), so you can ask the shell, what is its PID? What does that serve? The shell will terminate upon completion, so the PID is now for a terminated application. What can you do with the PID?

Henry



Thanks, Henry, for pointing this one out. I am new to programming in Linux. I am trying to get the session id of a user in Linux. Would you know how to execute BASHPID in such a way that it gets the PID of the currently active user?
13 years ago
Thanks for reminding me. I got the solution. I changed it to ProcessBuilder.

13 years ago
Hi, I am new to programming Java in Linux environment.

I need to get to execute "echo $BASHPID" in the terminal console of Linux and get the value returned.

I tried the following codes:



however, an error occurs when I execute the program. It does not recognized "echo $BASHPID". It throws "java.io.IOException: Cannot run program "echo $BASHPID": java.io.IOException: error=2, No such file or directory." Did I miss out a command function?
13 years ago

James Sabre wrote:

Erik Deveza wrote: I have read that Ubuntu can only execute jnlp using jre 1.5,



Could you indicate where you read that because my experience indicates that it is wrong! I use OpenJDK 1.6 with WebStart on Ubuntu 10.10 without any problems.


Sorry about that. JRE 1.6 can also run JNLP. It's the openJdk that I had some problems with.
13 years ago
This is working already. I can run my JNLP files already. I just wanted to share the solution.

I performed the following in Ubuntu:

Execute "gksudo gedit /etc/apt/sources.list"
Insert "deb http://us.archive.ubuntu.com/ubuntu dapper universe multiverse" at the last portion of the text file
Execute "sudo apt-get update"
Execute "sudo apt-get install sun-java5-jre"
Click Tab to highlight "OK" button and press Enter.
Execute "sudo update-alternatives --config java"
Execute "javaws http://111.222.333.444:80/application_with_jnlp_ext"


13 years ago
Hi, I am trying to run a jnlp through javaws in Ubuntu's built-in openJDK 6.0. My problem starts when my application does not work and throws an exception using the built-in java version. I have read that Ubuntu can only execute jnlp using jre 1.5, so I uninstalled openJDK and now I am trying to install JRE 5.0.

I am new to Ubuntu and don't know how to install a simple JRE in Ubuntu. I found no jre for i686 architecture so I downloaded jre for i586. I managed to extract the bin package but the system cannot recognize the bin executables. When I enter "java" in Terminal window, it displays the following "The program java can be found in the following packages:" It then points me to the built-in openJDK.

How do I install JRE 5 in Ubuntu to run a jnlp through javaws?
13 years ago
I am guessing that there is no available library for this. So what I'll just do is to execute "echo $BASHPID" and manually parse the output in Java.
13 years ago

Tim Sparg wrote:edit sorry just re-read that, you're looking for the session ID not userID


No worries. Thanks though for dropping your comment.

I successfully extracted the user session ID from Windows through JNA. However I am having no luck in getting the session ID from Linux. Does Java have Linux set of libraries to get this information?
13 years ago

Rob Spoor wrote:JNI is another option, but it's more complex since you will also need to figure out which native calls to use.



JNI looks prettier and more stable. Thanks, Rob!
13 years ago

Ernest Friedman-Hill wrote:
Welcome to JavaRanch!



Thanks very much!

Ernest Friedman-Hill wrote:
As far as APIs -- using Runtime.exec() to run the "query session" command is about it.



Ok, then. Manual parsing it is.

Cheers!
13 years ago
Hi, I am currently trying to retrieve the session ID of my Windows user name through Java.

Manually I can do this by entering "query session" in MS command prompt. This shows the sessionname, username, id, state, type and device of all connected users including remote access sessions. The column id represents the session id. This is the exact data that I need in my Java application.

Is there an API in Java that I could use to retrieve that session id across operating systems?

Any input is highly appreciated.
13 years ago