zoukankan      html  css  js  c++  java
  • linux中安装firebird

    本在树莓派上安装sqlite,因为sqlite的多用户需要自己控制读写。最终选择稳定够用的fb2.5。

    嵌入式无论哪一种fb都差不多。

    1、安装
    sudo apt-get install firebird2.5-super
    sudo dpkg-reconfigure firebird2.5-super
    sudo apt-get install firebird2.5-examples firebird2.5-dev
    2、启动
    systemctl start firebird2.5-super
    3、停止
    systemctl stop firebir2.5-super
    //注意:把配置文件中相关参数打开。如远程3050端口。否则远程无法连接   

    //qt连接FB
    #include "QSqlDatabase.h"
    #include "QMessageBox.h"
    #include <QSqlError>
    #include <QSqlQuery>
     
     QStringList a = QSqlDatabase::drivers();
     QMessageBox::information(NULL, "", a.join("_"));
     QSqlDatabase db = QSqlDatabase::addDatabase("QIBASE");
     db.setHostName("localhost");
     db.setUserName("sysdba");
     db.setPassword("masterkey");
     db.setDatabaseName("D:\FBDatabase\Test.fdb");
     if(!db.isValid())
     {
      QString lastError = db.lastError().text();
      QMessageBox::information(NULL, "", lastError);
     }
     if(!db.open())
     {
      QMessageBox::information(NULL, "","Error");
     }
     QSqlQuery qry = QSqlQuery("Select Count(*) From PERSON");
     qry.exec();
     qry.next();
     QMessageBox::information(NULL, "", qry.value(0).toString());
    

      goodluck!


  • 相关阅读:
    信号量Semaphore
    进程锁Lock
    创建多进程Process
    什么是进程?什么是线程?进程和线程之间的区别是什么?
    Git命令
    xss攻击问题以及如何防范
    ORM跨表查询问题
    for循环将字典添加到列表中出现覆盖前面数据的问题
    Linux源码的目录结构
    嵌入式中 MMU的功能
  • 原文地址:https://www.cnblogs.com/usegear/p/13695757.html
Copyright © 2011-2022 走看看