Bookmark Topic Watch Topic
  • New Topic

do i need odbc to run java applications - reg connection  RSS feed

Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Report post to moderator
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 .

Author and ninkuma
Posts: 66352
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question more than once.
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!