Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
JDBC e MySql
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
This topic is locked: you cannot edit posts or make replies.    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
vaporino
Tux's lil' helper
Tux's lil' helper


Joined: 10 May 2006
Posts: 126

PostPosted: Mon Sep 11, 2006 11:03 pm    Post subject: JDBC e MySql Reply with quote

Ciao ragazzi........
volevo fare un piccolo database usando java e mysql.........
ho seguito un po di guide e ho cercato per prima cosa di connetermi con mysql usando il connettore jdbc della sun.

Qui di seguito vi riporto il codice della mia applicazione:
Code:

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

// Notice, do not import com.mysql.jdbc.*
// or you will have problems!

public class LoadDriver {
    public static void main(String[] args) {
     
            // The newInstance() call is a work around for some
            // broken Java implementations
try {
            Class.forName("com.mysql.jdbc.Driver").newInstance();
}catch (Exception ex)
{
   
}

try {
               Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/db?user=root&password=********");

        } catch (SQLException ex){
           System.out.println("SQLException: " + ex.getMessage());
            System.out.println("SQLState: " + ex.getSQLState());
            System.out.println("VendorError: " + ex.getErrorCode());
            // handle the error
        }
}
}


Ma non capisco perchè ottengo

Code:


SQLException: No suitable driver
SQLState: 08001
VendorError: 0


Cosa significa ??? e come faccio vedere se mi sono connesso a mysql??
Back to top
View user's profile Send private message
lavish
Bodhisattva
Bodhisattva


Joined: 13 Sep 2004
Posts: 4296

PostPosted: Tue Sep 12, 2006 5:37 am    Post subject: Reply with quote

Thread chiuso poichè duplicato.
_________________
minimalblue.com | secgroup.github.io/
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies.    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum