Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have created a web page which has a form using HTML. I validate the entries made by the user using javascript, and then I read the data entered using doPost method of HttpServlet. Now, I want to store this data in a database. How do I proceed? What new things should I learn? Where does JSP and JDBC SQL come into picture? I am a newbie and trying to learn and implement.
Now I want to store this data in a database. How do I proceed?
You need to learn JDBC, it's an API which provides methods to communicate with the database. SQL [Structure Query Language] is a language which is used to communicate with the database, you write your queries in SQL to extract & insert data to & fro from db. The best resource to start with SQL in opinion would be this.
JSP forms the view of the application. Each thing has its respective role.
Check out the image
This question has some good answers as to how to go about learning Java based web development.
Either way, you have to start with Servlets and as for JSP, architecturally, JSP may be viewed as a high-level abstraction of Java servlets. JSPs are translated into servlets at runtime.
Then and only then move on to web frameworks. This compares different Java web frameworks out there. My personal preference is Spring MVC, it's also the most popular.
Learn what an ORM does and then move on to Hibernate which is an ORM for Java..
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
i am not a pro with programming, and i'm trying to build a desktop app with java, but i need to combine it with sql in order to store a lot of info in a table (database..)
and when i googled i found hours of tutorials to learn sql,
i'm still struggling with java and i have no time to deal with sql too...
can i do this without learn the sql language and all...?
do i have to sit down and study it all or is there another way around?
(p.s. sorry, i think my english not that good...)
Well there's some options:
Use files instead of a database. You can make use of serialization to store your instances directly on files.
Use a non relational database so you won't have to deal with learning SQL
Use an SQL database but search for an ORM. ORMs let you interact with relational databases without typing SQL directly (but you can if you need to when necessary)
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am newbie with database. I have knowledge of java. I am using play framework(java not scala) to develop a web app.
Now for storing informationof users I need to setup a database. As I have no experience with any type of database. I searched and short listed 3.
Mysql
Mongodb
Cassandra
I have seen a lot of examples of implement this database in java project using jdbc. Using there query language. Example: SQL in java.
I don't know any query language. Also I don't want to learn query language and delay the project
After going through the database vendors site. They provide drivers. So my questions are:
Can I use mysql without learning sql. Using driver. Connecting to database to do crud etc without creating schema. With only java. I know other listed database are schema free. So can I do the query in those database also with only java syntax.
When I searched I came to know about hibernate and spring data. Can I connect to database using this framework without the use of query language of those databases.
I wanna know a practical way to connect with those listed database without knowing there query languages.
No, I don't think what you're asking is possible. And if it is possible then I certainly wouldn't recommend it.
Hibernate will shelter you somewhat from having to do basic SQL commands for lookups and updates, however it's not a replacement, you will often have to fall back to HQL and possibly SQL. You really need to understand more about this before you start to use databases, otherwise you'll end up in a mess.
As for it delaying your project, it's better to delay the project than to continue in the dark. After all, time spent learning is never time wasted!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm going to create a desktop application (Swing) using the MVC. It will be chat and i have some questions. Which classes should be located on client? (View - its logical) Model? Controller? or both classes should be on the server side?
And which classes have to process my database?
If you are planning to have server-client and database access, this sounds like a typical 3-tier distributed system.
Database - represented as DBMS and located potentially on a separate machine. This should provide easy API for queries and updates from the server.
Server - this is where Model is located, again potentially on a different machine than database. Server however has means of working with the database, ideally via the aforementioned API.
Client - contains View and Controller. View is essentially the UI aspect of the Model located on the server. Controller processes user interaction and sends to the server in the processed (clean) form that the server can understand. This is done to reduce server load. The client has no means of accessing the database directly.
If it's all the same to you, I'd recommend to have a look at JavaFX, its MVC is much easier to implement and just plain simple to work with
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to make HTML website of course using CSS etc. But instead of using php for dynamic functions I would like to use Java. I have heard that there are plenty of web frameworks as Spring etc.
The problem is always when I search for tutorial - How to make java web? It shows me results with - web application, applet, servlet, JSP. I can't find short simple answer explaining how to start with that and what is the right thing to start with.
Would you mind telling me what should I use to make what I want? Just some short answer explaining what is what for. I remind you: I want to do some dynamic stuff on web based on Java instead of PHP.
EDIT:
I know I have to use dedicated server with Tomcat probably I am just looking for way to start. Should I start with the framework or?
I personaly only used Thymeleaf tutorials to learn about java-web and I'm satisfied with them, it has good-explained tutorials but it mostly teaches you how to process html templates with java.
If you do not want to follow thymeleaf tutorials, you should search for JAVA EE or JSP tutorials on either google or youtube, both provide well explained video tutorials for beginners
For my webserver I used tomcat which is easy to use and good with debugging. I recommand it
EDIT: A web application may have one or more jsps (java server pages). Servlets are requests from the browser to the jsp.
You must have VPS or Dedicated Server to use, because shared web hostings doesn't support languages like Java, C, C++, Node.JS and so on...
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I usually write my web services using PHP + Mysql, in a simplified way: reading the POST/GET params, connecting to the MySQL database and finally printing a JSON.
I'd like to check how to do this with a Java server, I've never programmed Java web servers and I'd like to know what should I study to learn to do it
Thanks
I'm supposing here that you have a good understand of java programming.
Fisrtly, I think you should understand java for web.
I recommend this book:
Head First Servlets and JSP
http://www.amazon.com/Head-First-Servlets-JSP-Certified/dp/0596516681/
Then you can learn web services with java:
Java Web Services: Up and Running
http://www.amazon.com/Java-Web-Services-Up-Running/dp/1449365116
Of course, there are many tutorials over the internet as well, but books give you a lot of background information.
I wanna suggest you garner understanding of the two main WebServices Architectures then decide which ones suit your case/use best
REST (GET,PUT,POST,DELETE,PATCH) JAX-RS
http://docs.oracle.com/javaee/6/tutorial/doc/giepu.html
vs SOAP bases JAX-WS
http://docs.oracle.com/javaee/5/tutorial/doc/bnayn.html
Comparing them:
Main differences between SOAP and RESTful web services in java