Java Applet shows form and components but no data from db

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Java Applet shows form and components but no data from db

panoss
I 'm trying to create an application that will be included in a site 's page.
That means an applet, right?

I 'm following the instructions from here (https://netbeans.org/kb/docs/web/applets.html#create) (up to "Build and run the applet source file").


It runs fine when I right click the Form.java->Run file.
(this class extends the JApplet)

BUT when I 'm trying in the localhost (http://localhost/joomla351/images/pgclassifieds/JavaApplets/LoansCalculator/build/Form.html), It shows the form with the components, but no data from the database.
Like if MySQL is not running.
What am I doing wrong? Shouldn't it display the data?

My folder-file structure is this:




Attachments:
http://forums.netbeans.org//files/loancalculatorfilestructure_156.png

Reply | Threaded
Open this post in threaded view
|

Java Applet shows form and components but no data from db

cp7781
Maybe the applet isn't allowed to connect to the database. I don't know. If I remember correctly, there is a security manager class, which can be configured with a policy file, and it required a secure signature, and blah. But all this stuff was really awkward, and not easy to manage or understand.

Applets never offered a multimedia experience, like Flash did. So, the underlying technology branch is pretty much dead for good reason.




Reply | Threaded
Open this post in threaded view
|

Java Applet shows form and components but no data from db

panoss
In reply to this post by panoss
The reason I want to make a web app with Java is that I 'm making a student 's work. The professor decided for Java + db + web.
If it were for me to decide, I would definitely not choose Java!
It's 3 days now I'm struggling and haven't managed to make it show the data in the browser!  [Shocked]

Thanks anyway!




Reply | Threaded
Open this post in threaded view
|

Java Applet shows form and components but no data from db

cp7781
In reply to this post by panoss
Well, Java on the server side can be a nice decision. It has a clean syntax and offers good hints for finding errors. The necessary technology is called Java Enterprise Edition (JEE), which is somewhat different to an applet.

But beware of the complexity.

It has basically the same capabilities like any easy PHP or Perl script. Which, as a fact of its own, is absolutely awesome. Read the official tutorials, and the busy authors will quickly jump over that fact, to get their tense work done. You will surely miss the sweet spot. Because, on top of that, it offers so much more, that you can easily invest months, if not years, to get a practical grip on it. So, in the end, Java EE sucks and succeeds, depending on your very own approach on it.




Reply | Threaded
Open this post in threaded view
|

Re: Java Applet shows form and components but no data from db

Simon, Charles X. -ND
In reply to this post by panoss
Sounds like you want to build what is called a CRUD application.  You want to start with a maven Web app and add in JPA (Java Persistence API) for the database access.
The JPA functionality allows you to map to existing tables or to create the tables based on a Java class definitions.  

Find a good JPA tutorial and you should be all set.

-----Original Message-----
From: panoss [mailto:[hidden email]]
Sent: Wednesday, July 27, 2016 10:20 AM
To: [hidden email]
Subject: [nbj2ee] Java Applet shows form and components but no data from db

The reason I want to make a web app with Java is that I 'm making a student 's work. The professor decided for Java + db + web.
If it were for me to decide, I would definitely not choose Java!
It's 3 days now I'm struggling and haven't managed to make it show the data in the browser!  [Shocked]

Thanks anyway!