database connectivity using mysql
java file: eg1.java
package eg;
import java.sql.*;
public class eg1
{
public static void main(String arg[]) throws SQLException
{
try
{
String connectionURL = "jdbc:mysql://loaclhost:1522/mydb";
Connection connection = null;
Statement statement = null;
ResultSet rs = null;
Class.forName("com.mysql.jdbc.Driver").newInstance();
connection = DriverManager.getConnection(connectionURL, "root", "girija1");
statement = connection.createStatement();
String QueryString = "SELECT * from student";
rs = statement.executeQuery(QueryString);
while (rs.next())
{
System.out.println(rs.getString(1));
}
rs.close();
statement.close();
connection.close();
}
catch (Exception ex)
{
System.out.println(ex);
}
}
}
error:
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
Compiling 1 source file to C:\Users\ShruthandSmith\Project7\3\WebApplication5\build\web\WEB-INF\classes
compile-single:
run-main:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
BUILD SUCCESSFUL (total time: 0 seconds)
I am using Netbeans 5.5, mysql server 5.0, to get data from table student. but while running this code i am getting error as mentioned above...... please check it and tell me what is the problem......
View Answers
Ads
Related Tutorials/Questions & Answers:
database connectivity using mysql
database connectivity using mysql java file: eg1.java
package eg... seconds)
I am
using Netbeans 5.5,
mysql server 5.0, to get data from table...[]) throws SQLException
{
try
{
String connectionURL = "jdbc:
mysql
Advertisements
database connectivity using jsp code
database connectivity using jsp code i have two tables employee... key)this is employee table schema in
mysql
adduser->(Emp_ID varchar(50),Ename...(10)) this is adduser table schema in
mysql
connectivity with mysql
connectivity with mysql if this code of roseindia doesnt work.../phpdatabase/Check-PHP-
MySQL-Connectivity.html
Please visit the following.../tutorial/php/phpdatabase/
http://www.roseindia.net/sql/
mysql-example/php-
mysql
database connectivity
database connectivity how to create
database connectivity between HTML and sql server2005
j2me mysql connectivity
j2me
mysql connectivity I do a project on reservation
using j2me. I need a
connectivity to a
MYSQL database.
How do I do this
Thanks and regards
Karthiga
Image upload in mysql database using jsp servlet
Image upload in
mysql database using jsp servlet Hello, I need code to insert image in
mysql database, I have seen the code which is already in your portal but it is not inserting image into
database it save in the folder
login page using jsp servlrt with mysql database?
login page
using jsp servlrt with
mysql database? Description:
example:total users are 3.each use have username and password save in
mysql database table login.
After successfully login
user1 see only index page,if user2 login
Unable to upload a file to mysql database using struts1
Unable to upload a file to
mysql database using struts1 Hi,
Below are my classes
1.upload.jsp
<%@ taglib uri="/tags/struts-html" prefix="html...=DriverManager.getConnection("jdbc:
mysql://localhost/test","root","");
System.out.println
database connectivity
database connectivity i m trying to connect this servlet with
database but i m not able to
Code is ot giving any error and there is no update in
database plsss somebody can help
code is here
package newpackage;
import
Database Connectivity
Database Connectivity I tried to establish
database connection with sqlserver2008 through GlassFish server.
When I set the path of sqljdbc.jar(E:\Glass Fish\glassfish-v2ur1\javadb\lib\sqljdbc.jar) it shows me error
database connectivity
database connectivity i have written class.forName and getconnection in one method which returns connection string object under particular class and in someother class i want to call that for statement object
jdbc connectivity to mysql tutorial
jdbc
connectivity to
mysql tutorial here is complete jdbc
connectivity to
mysql tutorial for newbies. Person who don't even know how to install
mysql and don't know about which driver to use can do with ease
retrieve related data from database using jsp and mysql
retrieve related data from
database using jsp and mysql Hi sir,
please give some example of jsp code for retrieving
mysql database values in multiple dropdown list. if we change a value in a dropdown its related value must
MYSQL Database
MYSQL Database Can any one brief me about how to use
MYSQL Database..., the
MySQL database server is most popular
database server and if you want to know about creating table and
using MYSQL, just follow the below link
Access 2007 database connectivity
source and destination. pls tell me the code of
connectivity with access 2007
database using JComboBox.thanks...Access 2007
database connectivity i design an application form
database connectivity problem
database connectivity problem what if client dont have
database with them then what is other way to run successfully our programm
Please visit the following link:
http://www.roseindia.net/jdbc