• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
M Sparks
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Oceas Anderson
Greenhorn
Posts: 17
Android Chrome Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tim Holloway
Saloon Keeper
Posts: 18367
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Sheriff
Posts: 51453
87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a suitable subject for the “beginning” forum. Moving discussion
 
K. Tsang
Bartender
Posts: 3585
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
M Sparks
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
K. Tsang
Bartender
Posts: 3585
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
M Sparks
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll give it a try, thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic