Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #28662 > unrolled thread

SQLite issue

Started bymanguicho@gmail.com
First post2014-06-05 08:02 -0700
Last post2014-06-06 18:06 -0400
Articles 4 — 4 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  SQLite issue manguicho@gmail.com - 2014-06-05 08:02 -0700
    Re: SQLite issue Joerg Meier <joergmmeier@arcor.de> - 2014-06-05 22:31 +0200
    Re: SQLite issue Steven Simpson <ss@domain.invalid> - 2014-06-06 13:51 +0100
      Re: SQLite issue Arne Vajhøj <arne@vajhoej.dk> - 2014-06-06 18:06 -0400

#28662 — SQLite issue

Frommanguicho@gmail.com
Date2014-06-05 08:02 -0700
SubjectSQLite issue
Message-ID<80f36094-2915-477a-9995-e86bde85587c@googlegroups.com>
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!

[toc] | [next] | [standalone]


#28665

FromJoerg Meier <joergmmeier@arcor.de>
Date2014-06-05 22:31 +0200
Message-ID<18171n07sfb10$.dc4riced9s3s$.dlg@40tude.net>
In reply to#28662
On Thu, 5 Jun 2014 08:02:08 -0700 (PDT), manguicho@gmail.com 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.

[toc] | [prev] | [next] | [standalone]


#28676

FromSteven Simpson <ss@domain.invalid>
Date2014-06-06 13:51 +0100
Message-ID<k2q86b-mu4.ln1@s.simpson148.btinternet.com>
In reply to#28662
On 05/06/14 16:02, manguicho@gmail.com 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

[toc] | [prev] | [next] | [standalone]


#28678

FromArne Vajhøj <arne@vajhoej.dk>
Date2014-06-06 18:06 -0400
Message-ID<53923b63$0$298$14726298@news.sunsite.dk>
In reply to#28676
On 6/6/2014 8:51 AM, Steven Simpson wrote:
> On 05/06/14 16:02, manguicho@gmail.com 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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web