• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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

 
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
 
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.
 
Saloon Keeper
Posts: 22483
151
Android Eclipse IDE Tomcat Server Redhat Java 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.
 
Marshal
Posts: 70234
282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a suitable subject for the “beginning” forum. Moving discussion
 
Bartender
Posts: 3648
16
Mac OS X Firefox Browser 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: 3648
16
Mac OS X Firefox Browser 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!
 
We can fix it! We just need some baling wire, some WD-40, a bit of duct tape and this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic