web service in java related problem - java

i want to bulid an web service application using java. main theme is i want to create a student database and users of the system will view a particular students information based on their authentication. for example an student can view his detail information but can't view detail info of another student.
my problem is how i will manage it? i am a novice for web service and all i know is from some tutorials where a 'Hello World' is printed or a calculator or converter application. there is no use of any database. so how can i build my application? how i will link it up with database?
normally i works in eclipse and microsoft sql server studio. so i am planning to do so for my project.
can anyone please help me. any tutorial, book or any idea regarding this will be helpful for me. please help and tell me what will be the steps for this work.

You can use either REST or SOAP as a web service architecture.
I have been using REST and followed this tutorial.
As long as the question of linking with database is there, once you go through the example, you will know where to insert the DB access code. There will be an annotated java file which will return responses. That is the place where you should query your database.
Anyways, i recommend you go through this tutorial first to get an idea of how it actually works.

Related

How to create java web form with spring, bootsrap, javascript that calls java method?

this is my first question on stackoverflow and I'm really confused..
I'm new with java and very confused at this moment. I'm planning to create a java web service with spring that handles a webform and a portable scanner device. I get this project for my first in new workplace but I can't move on. I don't know what are the neccesery steps to succeed.
What I want from the Application running step-by-step:
Open in an executable file that
Open a new browser window on localhost and shows a form
Filling out form with input fields, checkbox items, dropdown list,
commentbox,
AND Option for file upload from local and/or call startScan() java method.
startScan() = take photo from device and saves it to project's root folder and rename it as formatted date: "yymmdd_hhmmss"
submitButton()
onSubmitButton() the form data should be saved in database that
later i can download as xml
I have read lot of blogs and watch tutorials but that causes me confused. JPA? Hibernate? REST? REACT? I would like to create a very simple app that can display the form on window browser that is easy to access with bootsrap.
What is the neccesery toolset for doing this as simple as possible?
mysql? postgresql? which of these I can implement, what should i install locally?
If I could came out from back end to front that would be awesome..
Goal: Create a localhost database system that handles the form and scanner device method in a fancy css view.
Now, I'm using eclipse with spring. What are the neccesery dependencies? what are the local requirements for this kind of project? Please, help me with any advices..
I am very grateful for everything
Thank you in advance
I designed something similar, a simple two-page web application with login functionality and application main page that supports database operations and scanning functionality.
I would recommend you to go step-by-step since documentation is also as important, to be able to clearly visualize the project objectives, to know the constraints before-hand, make modifications on-the-fly and as a reference for your peers.
As a newbie with Java development, these are some basic steps and links which I feel would be helpful:
Project Scope Document (Web based tool: Draw.io)
Project Plan Document
Site Map (Web based tool: Draw.io)
Front-end Wireframing (Web-based tool: Balsamiq)
Back-end Wireframing (Microsoft Excel)
Back-end Flow chart (Web-based tool: Draw.io)
Front-end development (Technologies: HTML5, CSS3, Bootstrap 3, JavaScript; Tool: Brackets)
Back-end development (Technologies: PL/SQL or MySQL, Java, JDBC, Servlet, JSP, JSTL; Tools: SQL Developer, JBoss Studio)
Integrating Scanner (Third-party Java APIs)
Technology Stack: This is a simple and very generalized stack preference. You could customize it according to your needs.
Helpful Links on getting started: Java Web Terminology, JBoss Hello-world tutorial, Simple Java web application
Tools: Draw.io and Balsamiq are easy to use web based tools. You could use Bootstrap to make a quick fancy front-end. Brackets is a nice front-end code-editor supporting live-previews. SQL Developer is a wonderful tool if you're using Oracle SQL. JBoss Eclipse IDE has in-built application server which you can use for testing on localhost.
Note: All tools and technologies listed here are either free or include a trial version.
Hope that helps!

Spring+Hibernate+MySQL CRUD not working

I wanted to learn how to make a simple Spring+Hibernate+MySQL CRUD.
I found a tutorial. I wanted to run it on my PC first(to check if it's working and then learn what particular lines do). I downloaded the zip file and changed couple of things like name of the package or name of the database, the Spring/Hibernate version and so on.
Unfortunately the program is not working.
Of course there is a possibility that the tutorial is somewhere wrong but I bet that it's me not the tutorial that screwed something up.
If anybody have some free time I will really appreciate any help :)
This is a link to a github repo where I put code.
I use Eclipse and Tomcat 9.
Thank you in advance!
There is a lot easier way to get started with Spring completly from a scratch.
It's called Spring Boot and it is composed of an embedded servlet engine (Tomcat) and takes care of configuration of almost everything.
It doesn't require XML configuration which is a blessing and makes you feel like 2017, not 2000.
I found this video tutorial a very useful one and I can recommend it to you:
https://www.youtube.com/watch?v=vgPkUVF862g
Also, this series of video tutorials is excellent and explains everything about Spring MVC and Spring Boot, but it seems that first video is missing..
https://www.youtube.com/watch?v=C3ZrOj4unss

how to code in java for bigquery API

I'm trying to learn to use bigquery API to get data from google database and import it to another sql database. I'm using eclipse java what application project should I set up? what plugin should I install?anyone has experience with this?
I'm more of a C# person,I used windows app form before, dont know how to do that in java. can anyone give some advise? Thanks!
To be more specific,I simply want to create an ETL to get bigquery data to our datawarehosue,it doesn't have to be a UI,i just need it to run on the backend. I install google plugin4.3
Which project is the easiest for me to use? Any successful code to get data from bigquery servlet to somewhere else?
I don't know how to plug the code in from:
https://cloud.google.com/bigquery/bigquery-api-quickstart
Any instruction will be appreciated, thanks!
It sounds like you're looking for more of a general Eclipse tutorial than something BigQuery specific. You'd nominally create a "Java Project" to run simple Java code, but you'll need to set up the project to include your dependencies and so forth.
You may want to check these tutorials out : http://eclipsetutorial.sourceforge.net/totalbeginner.html
Alternately, you could Google for "eclipse tutorial" or "eclipse quickstart".

How can I implement Audit4J in my Java GUI application

This is my first time encountering Audit4J, and I'm wondering how I can implement that in my Java GUI project. I've tried reading the documentation in the website, but I wasn't able to grasp it concretely, and I've also seen the sample project for Audit4J in the github, but I wasn't able to understand it. Is there some other links, or can someone help me with it.
You should add audit4j-core as a dependency. If you want to save audit trails in to database you can should configure database handler in the configuration file in the classpath. Sample configuration file can be found here.
Then you'll able to submit audit event calling AuditManager. Please refer the documentation.

How to Integrate Oracle9i with JAVA or JSP?

I want to make a little application. That will have register, save, update, delete, login for user. This will be in JSP. I know JSP very well.
I have done some work JSP, with the MSAcess , SQL Server database with JDBC.
But I have naver ever use "Oracle" for this. But I really want to do this with Oracle 8 or 9 version. I search and found different type of method for integration.
Can you please help me for "How to Integrate Oracle with java or JSP?" if you have some examples, code , links , blog , tutorials, please share if that can help me.
Thanks in Advance
Everything else is pretty similar except that you need a different database driver. You can check out this link and this link. You should also read about how to tune your code for optimal performance and a good read on that topic is here.
This would also be a good time for you to get introduce to the DAO pattern. A good example is here.

Categories