accessing mySQL database with Java

From: Raphi (rapsli_at_yahoo.de)
Date: 10/28/04

  • Next message: David Harper: "Re: accessing mySQL database with Java"
    Date: 28 Oct 2004 09:46:33 -0700
    
    

    Hello

    Finally i could get the jdbc driver to run, but the rest is still not
    running. i could successfully create a database and a table with the
    command line, but from the applet i wrote, i can't access it. here the
    code and then the error messagen:

    the name of the table is: esgeht.

    void database() throws ClassNotFoundException, SQLException{
                    try{
                            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                            System.out.println("ok. ist gegaxt");
                    } catch(ClassNotFoundException e){
                            System.out.println("nicht gegangen");
                    }
                            
                    String url = "jdbc:odbc:esgeht";
                    Connection con = DriverManager.getConnection(url,"admin","admin");
            }

    ok. ist gegaxt
    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Der
    Datenquellenname wurde nicht gefunden, und es wurde kein
    Standardtreiber angegeben
            at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
            at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
            at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
            at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
            at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at HelloWorld.database(HelloWorld.java:51)
            at HelloWorld.start(HelloWorld.java:32)
            at sun.applet.AppletPanel.run(Unknown Source)
            at java.lang.Thread.run(Unknown Source)

    any ideas what i could do???? while I'm asking... when i create the
    database. is it possible to use there a different password for each
    database??

    raphi


  • Next message: David Harper: "Re: accessing mySQL database with Java"

    Relevant Pages

    • Re: Error when binding value to prepared statement with SQL Server 2005
      ... Database version is 9.0.1399 ... > Arto Basmadjian wrote: ... >> I'm using the latest jdbc driver to connect to an Sql Express ...
      (microsoft.public.sqlserver.jdbcdriver)
    • applet + database
      ... I'm planning to write a simple applet to display database records. ... Am I correct in guessing I need to dl the J2SE 1.4.2 package? ... It seems that I need a JDBC driver for whichever database I ... The JDBC code is copied to the client ...
      (comp.lang.java.programmer)
    • Callablestatement.execute() and clearParameter() causing exception
      ... With SQL 2005 jdbc driver i connect to 2005 database using parameter ... A server cursor cannot be ... The same code when run against a MSSQL 2000 database, ... on a remote stored procedure or stored procedure with more than one SELECT ...
      (microsoft.public.sqlserver.jdbcdriver)
    • Re: What is the best way to interact with a JDBC database
      ... Instead of the MySQL JDBC driver use the MonetDB JDBC driver. ... I haven't tried Jruby except reading about it. ... to avoid using JRuby just for this requirement of accessing a JDBC database. ... this database from Ruby. ...
      (comp.lang.ruby)
    • Re: Java, Sql Server & encodings
      ... When you read strings from the database, ... When you finally write these Strings, ... The Servlet container should take care of the proper byte-array encoding. ... Is this conversion normally left up to the JDBC driver ...
      (comp.lang.java.programmer)