This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes do i need odbc to run java applications - reg connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Reply locked New topic

do i need odbc to run java applications - reg connection

riyaz udeen
Ranch Hand

Joined: Sep 11, 2005
Posts: 66
iam new to jdbc . i hav installed mysql 4.1.
since iam working on java & jdbc, i got the zip of connector/j 3.1.8.
i unzipped it in a folder-a & added the folder to class path env variables.moreover i also added the myconnector-java-3.1.8-bin jar file avl inside the above a - folder.moreover i did not found
the com & org sub directorie in the unziped folder-a.

when i runned this programm after sucessgully starting the mysql server
i got this messg:

SQLException: No suitable driver
SQLState: 08001
VendorError: 0

the programm is :

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.*;

public class start {
public static void main(String[] args) {

Statement st ;
String create;
create = " CREATE TABLE tea ( tea_name VARCHAR (20), id NUMBER (3))";

try {
} catch (Exception ex) { }

try {
Connection c = DriverManager.getConnection("jdbc:mysql://");
st = c.createStatement();
st.executeUpdate (create);
catch (SQLException ex) {
// handle any errors
System.out.println("SQLException: " + ex.getMessage());
System.out.println("SQLState: " + ex.getSQLState());
System.out.println("VendorError: " + ex.getErrorCode());

kindly provide me the rectification for this problm.moreover i dont have mysql driver in my system.thank u .

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63873

Please do not post the same question more than once.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: do i need odbc to run java applications - reg connection
It's not a secret anymore!