Hello,
I want to write sensor data to a MySql DB but are having some problems getting a connection with MySQL Connector/J version 5.05. The problem is properly rooted in the environmental variables in the cygwin setup. Following line: export set CLASSPATH='\'E:'\'MyWeb'\'mysql-connector-java-5.0.5'\'mysql-connector-java-5.0.5-bin.jar:$CLASSPATH should set a non permanent env variable, at least it looks right when running env in Cygwin. Still I get Exception: com.mysql.jdbc.Driverimport java.sql.Connection; - when running following program:

import java.sql.DriverManager;
import java.sql.SQLException;
public class JdbcExample1 {
 public static void main(String args[]) {
   Connection con = null;
   try {
     Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection("jdbc:mysql:///test", "root", "MySql");
     if(!con.isClosed())
       System.out.println("Successfully connected to MySQL server...");
   } catch(Exception e) {
     System.err.println("Exception: " + e.getMessage());
     e.printStackTrace();
   } finally {
     try {
       if(con != null)
         con.close();
     } catch(SQLException e) {}
   } }}

Mikael

_______________________________________________
Tinyos-help mailing list
[EMAIL PROTECTED]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to