473,320 Members | 2,073 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

connectivity between jsp & MYSQL

can anybody tell me how to connect jsp with MYSQL?
Feb 29 '08 #1
1 1245
can anybody tell me how to connect jsp with MYSQL?
*****************************
step1:download the mysql_connector.jar ,place it in webapps/lib
step2:try the following code in jsp
**************************
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection("jdbc:mysql://<ip_address>/<data_base_name>","<username>","<password>");
java.sql.Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select * from <table_name>");
while(rs.next())
{}
Feb 29 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Gaz Oakley | last post by:
Hi, I've looked through the mailing list archives trying to find the best ways of connecting to a MySQL database using Python. From what I've seen, people seem to be using...
4
by: MLH | last post by:
A programmer developed an AMP (Apache/MySQL/PHP) application for me. When he was done, he sent me the PHP files and the MySQL dump file. Now, when I connect to the application on my LAN using...
3
by: junaid | last post by:
Hi to all, Can it is possible to connect to the databse like postgre or mysql through a C programm? I know the basics of C and I have developed a small program which uses a file for the...
6
by: Jay | last post by:
hi people i am trying to connect to ppstgresql on a debian system using perl . i am getting the following error .can any one please suggest what has to be done install_driver(pg) failed:...
3
by: Darius | last post by:
Hello, there is an NMEAParserDemo application written in VC++ avaliable for download from http://www.visualgps.net/Papers/NMEAParser/NMEAParserDemo%20Project.zip. Source code in VC++ is...
1
by: dipal | last post by:
I m totally new to php and mysql i got the following error connectivity error in mysql due to authentication protocol i have instaled mysql 4.1 and php 4.1 but still i get this error so can...
2
cpiyush
by: cpiyush | last post by:
Hello, I have query related to MySQL connectivity. When we make a connection with MySQL and we don't use this connection for some particular amount of time (I don't know what) it automatically...
1
by: swethak | last post by:
hi, when i run a java program for to store data and retrive using mysql datatabse i got the following errors.I think in that one of error is due to set the class path.I placed my...
0
by: balagh | last post by:
To access the table in oracle from MySQL. is there any connectivity code r steps to be followed
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.