|
Thx a Lot David.Tht link is very helpful and solves my prob.
And actually bufferedReader.readLine is coming null tht i just forget to write.
Anyway,Thx again.
Regards
Yogesh
|
|
|
|
|
Hi
There is no problem to convert JSON which looks like this:
"{\"response\": {\"Code\":200, \"Text\":\"Ok\", \"Id\":\"123\"}}
to the following object:
public class JsonCL
{
private int Code;
private String Text;
private int Id;
setters;
getters;
}
But what about the JSON, which contains arrays of data, and nested arrays?
For example:
{\"response\": {\"Code\":200, \"Text\":\"Ok\", \"Id\":\"123\", \"data\":{\"groups\": [{\"key1\":\"value1\", \"nestedData\":[{\"key1\":\"value1\", \"key2\":\"value2\", \"key3\":\"value3\"},{\"key1\":\"value4\", \"key2\":\"value5\", \"key3\":\"value6\"}]},{\"key1\":\"value2\", \"nestedData\": [{\"key1\":\"value7\", \"key2\":\"value8\", \"key3\":\"value9\"},{\"key1\":\"value10\", \"key2\":\"value11\", \"key3\":\"value12\"}]}]}}}
How can I convert such JSON into java object?
Thanks!
|
|
|
|
|
|
Hello all dear friends
I was wondering if anyone can helps me, I'm doing my final year project and it's on VPN in Java , so can anybody provides me with an idea, tip or anything to do in VPN and I'll be so thankful
The way of Professional softwares start in two:
Simple codes and develop it.
Simple but effective ideas.
|
|
|
|
|
Try doing your own research - start with Google "VPN Java" and go on from there. When you hit a problem then try asking a specific technical question.
It's time for a new signature.
|
|
|
|
|
thx I've tried a lot and thus why I'm here asking , If I found a solution I wouldn't be here , thx for ur time
The way of Professional softwares start in two:
Simple codes and develop it.
Simple but effective ideas.
|
|
|
|
|
ZaidIT wrote: I'm doing my final year project and it's on VPN in Java
So this is your final year project but you have no ideas about it, but you expect someone here to provide a solution. You need to understand that this site is setup to help people who do their own work but get stuck on technical problems or bugs. We don't have the time to provide full solutions, design specifications etc. If you really have no idea where to start with this project may I respectfully suggest you try something within your skill set.
It's time for a new signature.
|
|
|
|
|
Richard MacCutchan wrote: If you really have no idea where to start with this project may I respectfully suggest you try something within your skill set.
I second that, especially looking back at his posts from about 2 years ago. He should pursue a different career perhaps.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
No one asks for ur help so keep yourself away, thx for ur time too.
The way of Professional softwares start in two:
Simple codes and develop it.
Simple but effective ideas.
|
|
|
|
|
ZaidIT wrote: No one asks for ur help so keep yourself away
Actually it was you who asked for help and anyone is free to comment or otherwise respond to your question. Your response is rude and unwarranted.
It's time for a new signature.
|
|
|
|
|
Yeah, just look at my reply to his rudeness. I guess I'll add him to the list of rude and incompetent people to not help.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
ADD ME WHERE EVER U WANT , YES I'm crying right now , LOOOK respect urself is better for U , if U look at my previous messages I looked at yours also , I didn't foud just the gibberish
The way of Professional softwares start in two:
Simple codes and develop it.
Simple but effective ideas.
|
|
|
|
|
ZaidIT wrote: foud just the gibberish
Hardly, and do brush up on your grammar. If you noticed, the past few posts, I'm actually trying to help you out a bit in terms of how you reply to people. I have been in I.T. for probably longer than you have been alive and the way you are behaving will not last in a corporate world environment.
You want to work on your grammar, if English is not your primary language, as I have noticed you are from Iraq and I am assuming English is new for you, so practice it and you'll succeed at it
Also, please refrain from txtspeak gibberish because it is not a professional form of communication.
Peace out, man, and good luck in your endeavors.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Thx for ur time
The way of Professional softwares start in two:
Simple codes and develop it.
Simple but effective ideas.
|
|
|
|
|
Sorry friend , I don't think I've mention ur name to help me , I asked the people that they're supporter , they have a suit manner to reply , so I'm asking if no one want to help , so please don't make me joke and everyone start to show of his abilities , Thx for all for u time. and this will be my last time writing anything. God bless U all
The way of Professional softwares start in two:
Simple codes and develop it.
Simple but effective ideas.
|
|
|
|
|
Wow, with an attitude like that, good luck getting help for anyone. Also an attitude like that will not get you far in the workplace either. Looking at your previous posts and level of competency, you might want to look at different careers. Wasn't meaning to pick on you, but just suggesting.
ZaidIT wrote: so keep yourself away
No, I have every God given right to post a message here if I want.
Besides, I was replying to Richard, not you.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I don't any help form anyone, I though this forum have some professionals to take their advice, but I might be mistaken, So don't tired yourself by reply and that's it the subject is colse I don't need anything, thx for U time
The way of Professional softwares start in two:
Simple codes and develop it.
Simple but effective ideas.
|
|
|
|
|
ZaidIT wrote: this forum have some professionals to take their advice, but I might be mistaken
In all honesty, we do not mind helping people when they are stumped on a problem. Now, from a seriously professional stand point, all the other posts set aside, you should be asking your professors for suggestions in your project. A project doing a VPN in Java does sound very interesting and they should be able to help you to an extent. That is what they are supposed to be there for. That is what they are being paid for, to help you become the software developer you want to grow into.
If you already have the project going and are stumped with some sort of logic error or have an idea how to tackle a particular task but are having trouble with it, then people will be more willing to help.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hi, I'm new in Java and have the following task to do:
I have some data stored in gzip byte array and I have to insert it into MySQL database.
I'm using DBCP (Apache Tomcat 6.0.20) not JDBC.
I tried the following code:
PreparedStatement pstmt =(PreparedStatement)con.prepareStatement("insert into test_tb (id, data, compressed_data) values(?, ?, ?)");
pstmt.setString(1, cl.getOwner());
pstmt.setString(2, "");
pstmt.setBytes(3, cl.getCompressedData());
int i = pstmt.executeUpdate();
but this didn't work because of Cast Exception - java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement cannot be cast to com.mysql.jdbc.PreparedStatement
What is the right way to do it?
Thanks.
|
|
|
|
|
Declare pstmt as java.sql.PreparedStatement, not com.mysql.jdbc.PreparedStatement.
|
|
|
|
|
Hi,
I've a diamond shape image inside a label, inside that image(label) I want place one more label(image name). Is it possible?
Is it possible to resize the image dynamically by using mouse pointer?
Thanks in advance
Regards,
Janaki
|
|
|
|
|
no, it is not possible to place a JLabel[^]in another JLabel.
You should try to use JPanel[^].
greets
Torsten
I never finish anyth...
|
|
|
|
|
Hi,
Can you give me a forth to handle this?
Is it possible to resize?
Thanks in advance.
regards,
Janaki
|
|
|
|
|
public class Interference extends Thread {
String name;
static boolean isZero = true;
static int counter = 0;
public static void main(String arg[]) {
MyThread m = new MyThread();
m.setName("Important Thread");
m.start();
synchronized(m){
try {
System.out.println("Waiting for " + m.getName() + " to Complete....");
m.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
System.out.println("Main Work Started");
System.out.println("Hello");
}
Interference(String nameString) {
name = nameString;
}
public void run() {
System.out.println(name + " Started....");
for(int i=0; i<100000000; i++) {
if(isZero) {
isZero = false;
counter++;
} else {
isZero = true;
counter--;
}
}
System.out.println(name + ": " + counter);
}
}
class MyThread extends Thread
{
public void run()
{
System.out.println(Thread.currentThread().getName()+" : Let me finish first !");
Interference inter = new Interference("NEW");
inter.start();
try {
inter.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
for(int i =0;i<1000;i++){}
System.out.println(Thread.currentThread().getName()+" : OK! do your work now");
}
}
The above code demonstrates a wait and notify scenario but I have not notified the object after MyThread's work finishes. I'm amazed that without notifying, how the wait() breaks. can anybody explain me.
|
|
|
|
|
If you read the javadoc for wait, you will see that you can get what are called "spurious wakeups".
begin quote:
As in the one argument version, interrupts and spurious wakeups are possible, and this method should always be used in a loop:
synchronized (obj) {
while (<condition does not hold>)
obj.wait();
...
}
end quote
I have no idea how a spurious wakeup can actually happen but at least it is documented behaviour.
|
|
|
|