T.A. Nguyen

Ranch Hand
+ Follow
since Sep 02, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by T.A. Nguyen

just create yourapp.jar and take along the derby.jar and place them both on the classpath before executing and that should work. All you really need is derby.jar
10 years ago
You should be able to quickly check to see if the result is xml. By XML the data must start with "<" and end ">". For JSON it a little bit more involve but you can learn more here: http://www.json.org/
For converting JSON to XML, the JSON library have an XMLSerializer class that can convert a json object / array into XML.

10 years ago

Marvin Legend wrote:
...


You should be using a PreparedStatement and let the jdbc statement do all the escaping for you. This is also prevent SQL injection too. And your code should be:
10 years ago

srinu pearl wrote:This is a interview question. I tried using pattern, it worked fast. But I am just able to search the word, but not able to print the line when match found.

int line = 0;

Pattern pattern = Pattern.compile("invalid holding");

txtscan = new Scanner(new File("C://logs/LM.2014-02-14.log"));

while (txtscan.findWithinHorizon(pattern,0) != null) {
System.out.println(line);
line++;
}


the method findWithinHorizon() return a line of data, you just need to assigned to a variable and display it.


That should do the trick!
10 years ago
Hello Saipraneeth,

You can use this tiny program I created here: http://ta.cnci.org/more-about-java/29-java-servers-and-services/232-remoteservice-a-simple-client-to-test-your-restful-and-soap-services
if you are accessing a BASIC authentication type. Different authentication will required different headers setting.

Good luck,
T.A.
10 years ago
As I said, please check with IBM driver installation and product for detail.

Originally posted by loganathan sadish:
Thanks Nguyen,

But i need some detail explanation about the host and the port.
Host means my windows machine ip or DB2 server ip? and how to find the port?

Thanks

You should check with the IBM driver forum for help!
No Suitable Driver, usually mean, that you don't have the correct url. The correct TCP/IP url should be like:
"jdbc:db2://host:port/database"

for remote connection. And you should use the com.ibm.db.jdbc.net.DB2Driver with it. Your com.ibm.db.jdbc.app.DB2Driver rely on the local connection and thus, the same code will not work on a remote machine, even with other Windows computer.

As of version 8, IBM moved to a unified driver you should use: com.ibm.db2.jcc.DB2Driver instead. Please check with IBM website for detail.
Here is the complete codes for DBHandler.java, please note the I move the main (test) method inside DBHandler.java, what's missing here is the actual code for CHRISInterface... have fun.

This is a typical singleton implementation. Accessing via a static method, the method control creation/access of the class static field. Remember, this is NOT the only way...


[ September 22, 2008: Message edited by: T.A. Nguyen ]
You should change to:

connect server
login user/password
passivemode on
binary on
nextfile: <- this label like you have seen it in some BASIC code
put file
GOTO nextfile
disconnect

alternatively, if the FTPClient package support, you should use the mput command instead.

connect server
login user/password
passivemode on
binary on
mput file1 file2 file3 file4 file5
disconnect
Yes, I meant for you to fix your server side codes, I assumed that you are writing in Java, and the socket connection should use the connect(ip, timeout) method. this will allow you to set a timeout. Also use the Thread.interrupt() to interrupt any thread that exceed the time limit.


...
But my query is ,could there be any way to directly hit shutdown,to remote
machine, through our program. (may be throuh rmi ,but i don't have any idea about).



Directly hit the shutdown... I am not sure I understand you correctly, is it the button you want to hit? Or a "shutdown" command you want to activate. They are 2 different things. Now, the "shutdown" command will be vary depend on which operating system. By activating the shutdown does not have the same effect of hitting the "shutdown" button because of the hardware different. In software, Java and other alike, in order for you to shutdown a remote machine, the target machine must be of some sort of server that awaiting for the shutdown command and execute/activate the operating system shut down command.
Not quite sure what you are asking, but in order for you to deliver the multimedia data, your servlet/jsp must handle multimedia. As for streaming video, there are many way, to do it. You may start here.
It vary. Is this something you like be able to control from Java environment? If not, there are many choice. But, in general, to be able to shut down a machine, you must access the external shut down command come with the operating system. In Java environment you will have to use the Runtime.exec() for the local system being shut down. And use socket or RMI as a vehicle to deliver the remote shut down command to the targeted machine (java server/receiver).

Originally posted by vasu chowdary:
I have four computers with LAN connection.how can i shutdown three computers using single computer.is this happen with java.net package?

It look like your CN=console02.wh.prod is not console.whitey.com, certificate not being issued to the correct domain? You should check on that.

When generate keystore file, the first question should be the domain of the CAS server, for you it should be: [console.whitey.com]

What is your first and last name?
[Unknown]: console.whitey.com


Originally posted by steve labar:
...

1 Subject EMAILADDRESS=noc@console02.wh.prod, CN=console02.wh.prod, OU=Network Operations, O="Whitey, Inc.", L=Santa Clara, ST=California, C=US
Issuer EMAILADDRESS=noc@whitey.com, CN=Whitey CA, OU=Certificate Authority, O="Whity, Inc.", L=Santa Clara, ST=California, C=CA

...

Error connecting: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No name matching console.whitey.com found