Click here to Skip to main content
15,917,971 members
Home / Discussions / Java
   

Java

 
GeneralRe: Loading a sound file from a jar archive Pin
jschell3-Jan-11 9:56
jschell3-Jan-11 9:56 
GeneralRe: Loading a sound file from a jar archive Pin
Pamodh4-Jan-11 4:23
Pamodh4-Jan-11 4:23 
Questionvalidation Pin
pancakeleh30-Dec-10 16:46
pancakeleh30-Dec-10 16:46 
AnswerRe: validation Pin
Richard MacCutchan30-Dec-10 23:00
mveRichard MacCutchan30-Dec-10 23:00 
GeneralRe: validation Pin
pancakeleh3-Jan-11 15:56
pancakeleh3-Jan-11 15:56 
GeneralRe: validation Pin
TorstenH.3-Jan-11 21:13
TorstenH.3-Jan-11 21:13 
GeneralRe: validation Pin
Richard MacCutchan4-Jan-11 1:56
mveRichard MacCutchan4-Jan-11 1:56 
QuestionJava MySQL Driver issue Pin
khurram_shahzad29-Dec-10 6:03
khurram_shahzad29-Dec-10 6:03 
Hi, i am trying to connect to MySQL database mysql using JAVA .. using code given below,

import java.sql.*;

public class dbExample{
  public static void main(String[] args) {
    System.out.println("Listing all table name in Database!");
    Connection con = null;
    String url = "jdbc:mysql://localhost:3306/";
    String db = "mydb";
    String driver = "com.mysql.jdbc.Driver";
    String user = "root";
    String pass = "root";
    try{
      Class.forName(driver);
      con = DriverManager.getConnection(url+db, user, pass);
    }
    catch (Exception e){
      e.printStackTrace();
    }
  }
} 


I've picked this example from internet .. and there lot more example i tried using this same driver String driver = "com.mysql.jdbc.Driver"; But this code all other i tried gives me error Driver Class not found ... at this statment Class.forName(driver); ..... and similarly on trying this driver sun.jdbc.odbc.JdbcOdbcDriver the above mentioned statment Class.fonName ... executes but then it gives error on statment con = DriverManager.getConnection(url+db, user, pass); error is No suitable drive found for jdbc:mysql://localhost:3306/mydb

I'm very much confused and tried it toooooo many time in diffrents ways that i could but still unable to create successfull database connection.
I've tried this using notepad / Netbeans both and both on WINDOWS7 and XP ... and both give same error to me .... Frown | :( Frown | :( Frown | :( Frown | :(

Please Please PLease give me any solution .... I shell be very very Thanksfull to you.
AnswerRe: Java MySQL Driver issue Pin
Min.Liao29-Dec-10 14:44
Min.Liao29-Dec-10 14:44 
GeneralRe: Java MySQL Driver issue Pin
khurram_shahzad29-Dec-10 20:30
khurram_shahzad29-Dec-10 20:30 
Questionjava.lang.IllegalArgumentException Pin
pancakeleh28-Dec-10 16:59
pancakeleh28-Dec-10 16:59 
QuestionProblem Pin
pancakeleh27-Dec-10 19:52
pancakeleh27-Dec-10 19:52 
AnswerRe: Problem Pin
Richard MacCutchan27-Dec-10 22:31
mveRichard MacCutchan27-Dec-10 22:31 
AnswerRe: Problem Pin
RaviRanjanKr14-Apr-11 6:00
professionalRaviRanjanKr14-Apr-11 6:00 
Questionconvert to integer? Pin
pancakeleh22-Dec-10 20:44
pancakeleh22-Dec-10 20:44 
AnswerRe: convert to integer? Pin
Cedric Moonen22-Dec-10 21:36
Cedric Moonen22-Dec-10 21:36 
GeneralRe: convert to integer? Pin
Member 450626727-Dec-10 23:43
Member 450626727-Dec-10 23:43 
AnswerRe: convert to integer? Pin
TorstenH.22-Dec-10 21:43
TorstenH.22-Dec-10 21:43 
AnswerRe: convert to integer? Pin
pancakeleh22-Dec-10 22:33
pancakeleh22-Dec-10 22:33 
GeneralRe: convert to integer? Pin
TorstenH.23-Dec-10 0:02
TorstenH.23-Dec-10 0:02 
GeneralRe: convert to integer? Pin
Cedric Moonen23-Dec-10 0:05
Cedric Moonen23-Dec-10 0:05 
AnswerRe: convert to integer? Pin
RaviRanjanKr23-Dec-10 4:42
professionalRaviRanjanKr23-Dec-10 4:42 
AnswerRe: convert to integer? Pin
vasehu27-Dec-10 13:23
vasehu27-Dec-10 13:23 
GeneralRe: convert to integer? Pin
pancakeleh27-Dec-10 15:14
pancakeleh27-Dec-10 15:14 
AnswerRe: convert to integer? Pin
bilal.hobnail4-Jan-11 19:08
bilal.hobnail4-Jan-11 19:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.