【问题标题】:Connect NetBeans to SQLite将 NetBeans 连接到 SQLite
【发布时间】:2017-03-13 21:02:32
【问题描述】:

如何将NetBeans IDE 8.2 连接到SQLite (3.16.1)

我已经用Java 尝试过,但我需要在C 中编码。 我想在Java 中建立连接,但随后编码 在另一个项目中使用 C 可能会有所帮助,但这不起作用。

【问题讨论】:

  • 只需编写调用适当 SQLite 函数的代码。究竟是什么问题?

标签: database netbeans sqlite netbeans-8


【解决方案1】:

如果你想用 JAVA 编码:

import java.sql.*;

public class SQLiteJDBC
{
  public static void main( String args[] )
  {
    Connection c = null;
    try {
      Class.forName("org.sqlite.JDBC");
      c = DriverManager.getConnection("jdbc:sqlite:test.db");
    } catch ( Exception e ) {
      System.err.println( e.getClass().getName() + ": " + e.getMessage() );
      System.exit(0);
    }
    System.out.println("Opened database successfully");
  }
}

https://www.tutorialspoint.com/sqlite/sqlite_java.htm

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-18
    • 1970-01-01
    • 2014-07-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多