SQLite issue

Discussion in 'Java' started by manguicho@gmail.com, Jun 5, 2014.

  1. Guest

    Mi problema es bien basico y me esta volviendo loco. Pido por favor a los expertos que me den un poco de luz al respecto.
    gracias!

    1)He bajado esto:
    https://bitbucket.org/xerial/sqlite-jdbc/downloads/sqlite-jdbc-3.7.2.jar

    2)generado SQLiteJDBC.java con el siguiente codigo:

    import java.sql.*;

    public class SQLiteJDBC
    {
    public static void main( String args[] )
    {
    Connection c = null;
    Statement stmt = null;
    try {
    Class.forName("org.sqlite.JDBC");
    c = DriverManager.getConnection("jdbc:sqlite:test.db");
    System.out.println("Opened database successfully");

    stmt = c.createStatement();
    String sql = "CREATE TABLE COMPANY " +
    "(ID INT PRIMARY KEY NOT NULL," +
    " NAME TEXT NOT NULL, " +
    " AGE INT NOT NULL, " +
    " ADDRESS CHAR(50), " +
    " SALARY REAL)";
    stmt.executeUpdate(sql);
    stmt.close();
    c.close();
    } catch ( Exception e ) {
    System.err.println( e.getClass().getName() + ": " + e.getMessage() );
    System.exit(0);
    }
    System.out.println("Table created successfully");
    }
    }
    3) Comiplado con :
    $ javac SQLiteJDBC.java
    4) al intentar ejecutar con:
    $ java -classpath ".;sqlite-jdbc-3.7.2.jar" SQLiteJDBC
    arroja el siguiente error:
    "Error: no se ha encontrado o cargado la clase principal SQLiteJDBC"

    desde ya muchas gracias!
     
    , Jun 5, 2014
    #1
    1. Advertising

  2. Joerg Meier Guest

    On Thu, 5 Jun 2014 08:02:08 -0700 (PDT), wrote:

    Hallo,

    > Mi problema es bien basico y me esta volviendo loco. Pido por favor a los expertos que me den un poco de luz al respecto.
    > gracias!


    Leider kann ich mit Deinen Worten nichts anfangen. Ich spreche diese
    Sprache leider nicht.

    Liebe Gruesse,
    Joerg

    --
    Ich lese meine Emails nicht, replies to Email bleiben also leider
    ungelesen.
     
    Joerg Meier, Jun 5, 2014
    #2
    1. Advertising

  3. On 05/06/14 16:02, wrote:
    > 3) Comiplado con :
    > $ javac SQLiteJDBC.java
    > 4) al intentar ejecutar con:
    > $ java -classpath ".;sqlite-jdbc-3.7.2.jar" SQLiteJDBC
    > arroja el siguiente error:
    > "Error: no se ha encontrado o cargado la clase principal SQLiteJDBC"


    Try using a colon ":" rather than a semicolon ";" to separate the
    elements of the classpath.

    --
    ss at comp dot lancs dot ac dot uk
     
    Steven Simpson, Jun 6, 2014
    #3
  4. Arne Vajhøj Guest

    On 6/6/2014 8:51 AM, Steven Simpson wrote:
    > On 05/06/14 16:02, wrote:
    >> 3) Comiplado con :
    >> $ javac SQLiteJDBC.java
    >> 4) al intentar ejecutar con:
    >> $ java -classpath ".;sqlite-jdbc-3.7.2.jar" SQLiteJDBC
    >> arroja el siguiente error:
    >> "Error: no se ha encontrado o cargado la clase principal SQLiteJDBC"

    >
    > Try using a colon ":" rather than a semicolon ";" to separate the
    > elements of the classpath.


    If he is using *nix.

    Windows is using semocolon.

    The use of $ indicates that he is likely using *nix.

    I would also be tempted to drop the "" marks.

    Arne
     
    Arne Vajhøj, Jun 6, 2014
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben Wolfson
    Replies:
    0
    Views:
    398
    Ben Wolfson
    Jan 24, 2007
  2. Ben Wolfson
    Replies:
    0
    Views:
    295
    Ben Wolfson
    Jan 24, 2007
  3. Alan Harris-Reid

    Threading issue with SQLite

    Alan Harris-Reid, Jan 29, 2010, in forum: Python
    Replies:
    3
    Views:
    1,477
    Alan Harris-Reid
    Feb 2, 2010
  4. Carl Youngblood
    Replies:
    1
    Views:
    234
    Carl Youngblood
    Apr 9, 2005
  5. Replies:
    4
    Views:
    352
Loading...

Share This Page