Forums Register Login

How to connect input data from Web App GUI in browser to MySQL database via NetBEans?

+Pie Number of slices to send: Send
Hello, I am trying to get the data that is typed into my GUI in my web browser to be added to a MySQL database I have running and connected to via NetBeans. I recently took the desktop app and made a web app and am having a hard time getting the data into the database? I don'y know if it's code related or that I don't have a file or path set in NetBeans or both? I also go to display the database info in the GUI on the browser and it gives me tho error:

HTTP Status 500 - Internal Server Error

type Exception report

messageInternal Server Error

descriptionThe server encountered an internal error that prevented it from fulfilling this request.

exception

javax.ejb.EJBException

note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 4.1 logs.

Thanks for any help!

-M
+Pie Number of slices to send: Send
What kind of framework are you using to make your "web gui"? If it was made in JSF or JSP you might get better assistance referring moving this to those specific sub-forums.
+Pie Number of slices to send: Send
If Netbeans is part of the "program" or GUI and your java code cannot talk to the database without it, then there's something seriously wrong with your software design.

Your error message indicates that the webapp is attempting to communicate with an EJB-based webapp running in a Glassfish JEE server and there's a problem running that app. Says nothing about NetBeans.
+Pie Number of slices to send: Send
Not a suitable subject for the “beginning” forum. Moving discussion
+Pie Number of slices to send: Send
First how is the app connecting to the database? JDBC inside app or through Glassfish JNDI? If latter is the resource set up properly?

What does the Glassfish log say?
+Pie Number of slices to send: Send
 

K. Tsang wrote:First how is the app connecting to the database? JDBC inside app or through Glassfish JNDI? If latter is the resource set up properly?

What does the Glassfish log say?



To be honest, this is my first time ever trying to do a Web App so I have MySQL running with a Database I created called "IT351" and connected by jdbc:mysql://localhost:3306/IT351?zeroDateTimeBehavior=convertToNull [root on Default schema]. For my desktop app I built I was storing data from the GUI into a database and then using NetBeans to check and see if the data was being added/updated to the database. This was successful. Then, I made a Web App that I wanted to take input on the GUI and store in the same database I had been using before (for the desktop app). I get errors now when do that: Ping Connection Pool failed for IT351Pool. No password credential found Please check the server.log for more details is the error when inside the GlassFish Admin Domain Console and
HTTP Status 500 - Internal Server Error

type Exception report

messageInternal Server Error

descriptionThe server encountered an internal error that prevented it from fulfilling this request.

exception

javax.ejb.EJBException

note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 4.1 logs.

When I click my SHOW ALL Button from the GUI. I made a new data resource and pool.
+Pie Number of slices to send: Send
Given your situation, it's your Glassfish connection pool problem. Make sure you put/mention the URL, user, password and database name, everything else can be default.

Also make sure the JDBC driver jar is in the Glassfish classpath (<glassfish-path>/glassfish-<version>/lib folder)

Edit: it's not good to use "root" and the user. Better to create a application (database) user and use that.
+Pie Number of slices to send: Send
I'll give it a try, thanks!
eat bricks! HA! And here's another one! And a tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1169 times.
Similar Threads
recovery photo
JPA application issue using netbeans 8.1
JDBC error
Problem in Struts Dispatcher
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 05:28:23.