mysql connection using jsp

5 pts.
Tags:
Java development
JSP
Linux OS
MySQL
how cna i connect mysql database with my login form using jsp in linux operating system?

Answer Wiki

Thanks. We'll let you know when a new response is added.

I provide the article just follow the steps:

Step 1 – Creating a MySQL database

Log into the Mysql, Enter a database username and password of your choice, the database name will be your username with “db” appended to it, so if you created a database called “amazon” your database name would be “amazondb”.

Step 2 – Connecting to MySQL using JSP and JDBC

Once you’ve successfully created your database can you connect to it using JSP via JDBC using the following connection example. Change the connection parameters in red to the ones you’ve chosen in Step 1.

<%@ page import=”java.sql.*”%>
<html>
<head>
<title>JDBC Connection example</title>
</head>

<body>
<h1>JDBC Connection example</h1>

<%

java.sql.Connection cn;
Class.forName(“org.gjt.mm.mysql.Driver”);
cn = DriverManager.getConnection(“jdbc:mysql://localhost:3306/database_name”, “database_username”, “database_password”);

%>

</body>
</html>

Note: No matter what os u r using. Just install Mysql for linux and web browser may be Firefox / safari

Hope u get the answer.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: