Jump to content
xisto Community
Sign in to follow this  
Inspiron

Connecting Jsp To Mysql

Recommended Posts

I've a project that has to be done on JSP. It is to create an online movie booking service that records customer's details, reserving tickets, changing seats etc.Now the problem for me is to connect from JSP pages to MySQL database so I can store the information in MySQL. Any step-by-step tutorials and ideas? I would appreciate with screenshots are available as I'm totally new to JSP and MySQL.Thanks in advance..

Share this post


Link to post
Share on other sites

Hi!

I just found a, I think, very good tutorial for you! It starts explaining which things you need to use MySQL with jsp, then it explains how to install these things, and everything else you need to know step-by-step.

Planet Source Code

It's a tutorial for using jsp / mysql with windows, I hope this is OK. I'm not using Linux...

If you are able to understand german, you could also have a look at this page:

JSP Devlop

I think this is a really greta page for a great width of jsp themes and for getting help with jsp related problems. You find there also little workshops and code pieces to download.

I hope this helps you a little bit!

Greets, Chris

Share this post


Link to post
Share on other sites

hi u can use jsp code for making connection between mysql and jsp
which need to make connection.
1. Need mysql jdbc connector. Download it from mysql website mysql-connector.jar file
2. Copy it to tomcat or lib folder of WEB-INF in lib folder.This jar file
3. Do little coding to connect it

	String connectionURL ="jdbc:mysql://localhost:3306/YourDataBaseName?user=root;password=";	Connection conn=null;	Class.forName("com.mysql.jdbc.Driver").newInstance();	conn = DriverManager.getConnection(connectionURL,"root","");	Statement st=null;	st=conn.createStatement();	ResultSet rs= null;
Try it

I've a project that has to be done on JSP. It is to create an online movie booking service that records customer's details, reserving tickets, changing seats etc.
Now the problem for me is to connect from JSP pages to MySQL database so I can store the information in MySQL. Any step-by-step tutorials and ideas? I would appreciate with screenshots are available as I'm totally new to JSP and MySQL.

Thanks in advance..


Share this post


Link to post
Share on other sites

I've a project that has to be done on JSP. It is to create an online movie booking service that records customer's details, reserving tickets, changing seats etc.
Now the problem for me is to connect from JSP pages to MySQL database so I can store the information in MySQL. Any step-by-step tutorials and ideas? I would appreciate with screenshots are available as I'm totally new to JSP and MySQL.

Thanks in advance..


Here is good tutorial. Try: http://jsptutorblog.blogspot.de/

Share this post


Link to post
Share on other sites

Hi!Hooking up Java to the MySQL database management system is not very different from hooking up to any other database management system. All that would change is the database driver that you use and the URL that you provide to JDBC to connect to the database.welcome77in posted the code. If you look carefully, you will notice that there are only two references to MySQL - one is on the first line, which refers to MySQL in the JDBC connection URL, and the other is in loading the database driver, which is specified using its fully qualified name on the third line where a new instance of the database driver class is being created. If you wanted to connect to any other database, you would simply swap out these statements for something else.Moving between database management systems, however, is not quite as simple as getting a connecting to the different database management systems. While getting a connection to the database is as simply as swapping out the JDBC connection URL and the database driver class name, the queries being made to the database would change. You would have different function names specific to the database management system being used, the type of quotes that you use might change from single quotes to double quotes, or the other way round, and you might have stored procedures that you invoke which differs the most between database management systems when you consider it from a development perspective because the store procedure extensions to SQL themselves are proprietary and vendor-specific as is their behavior. If you do have to move the data across between database management systems, it is just as complex because the data types of the columns may not match and the database management systems would have limitations on the maximum number of columns or the maximum data that can be stored per row, or perhaps even the maximum length of a column - all of which could create issues when moving across different database management systems.My point is that when you have worked with one database management system, it is easy to learn to move to another database management system but you do have to be aware that there will be code changes involved, unless the application was initially developed considering that the database management system could be swapped out with one from a different vendor.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.