URGENT JAVA HELP NEEDED A question to all you Java coders

kelso

Regular Member
Joined
Nov 30, 2009
Messages
479
Reaction score
276
A friend needs some java help and as he is not a member of BHW and does not know anything about it so I reckoned I?d try to help him by sourcing some advice from here.

So the task in hand is (so I?ve been told) pretty simple:

There?s a mySql database with 2 columns: cars and pictures.
In netbeans we have a class connector with which we are making a connection to the database.
He?s made a simple GUI (JFrame) with 2 buttons.
He wants 1 of the buttons to fetch car1 with picture1 and the other to fetch all cars with their appropriate pictures.

So the question is: what code should he add to those buttons so that they would fetch and display that data?
 
So my friend managed to get to a point where he wanted. Thanks bartosimpsonio for the try, and thanks to the others that contacted me and chimed in to help (not in the thread apparently).

So now I have another question on his behalf:

How to deploy an application in a web server?
He made an application in netbeans which reads from a database and shows the result in UI. When he secelts to deploy the project in a glassfish server what happens next is that localhost:8080/myapp opens but it only says "TODO write content".

In the project he has a file index.html with the following contents:

<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div>TODO write content</div>
</body>
</html>

And apparently his browser displays only this: <div>TODO write content</div>

So the question now is: How to upload the whole application on the server?

I hope I've paraphrased him correctly but I think that someone who understands thiss will know what I mean. Is it something that needs to be added to that index.html so that it connects to the application or what idk...

He wrote a lot of code to make this app - that shows users and pics. Now he needs to display it in a browser and for that purpose he needs to deploy it on a server. BUT when he opts to deploy it it only shows that body part from that html and the program is nowhere to be seen...
 
Need to assemble it into a war file. I use eclipse not net beans so I can't help you much more.
 
Need to assemble it into a war file. I use eclipse not net beans so I can't help you much more.

Thanks a lot for the input! Also could you shed some light and details about the war file necessity? Thanks again!

Anyone else?
 
Last edited:
Back
Top