This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Database connectivity problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Database connectivity problem" Watch "Database connectivity problem" New topic

Database connectivity problem

Rajesh k Jha
Ranch Hand

Joined: May 10, 2009
Posts: 72
I am new user to thif forum, Actually i want to use MySql in my JSP program but while connecting the database I am confused with this part "tring url="jdbc:mysql://localhost/books?user=<user>&password=<password>"; here user name and password is required but i dont know how to create user name in MySql, So can anyone tell me how to create a new user in MySql or if there is any default username then what is this, Please help me to solve my query (I m using MySql server 5.0)
Jan Cumps

Joined: Dec 20, 2006
Posts: 2491

Hi Rajesk,

Can I suggest you to first learn how to work with JDBC, before you start using it in a JSP?
Here is a good starting point for MySQL users.
The topic is difficult enough, so better start at the begin.
Once you know how to connect and query your MySQL database, you are ready for the next step.
Then, we will be telling you things like " never put JDBC code inside of a JSP"

Regards, Jan

OCUP UML fundamental and ITIL foundation
youtube channel
I agree. Here's the link:
subject: Database connectivity problem
Similar Threads
Setting up a database connection with Struts 2 and Tomcat 6.0
How to set administrative user in MySQL?
Modify persistence.xml file runtime
NOt able to connect to actual database on the web server
mysql autocommit