Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - QDB server & database not found: (5 Items)
   
QDB server & database not found  
Hi,
i have read about the qdb server under the help section and i have no clue on how to interact with it. Also when i use 
qdb_connect() to connect to the database, it replied with a "No such path or directory".
please advise.

Thanks,
Jian Rong
Re: QDB server & database not found  
Read through the "Starting QDB" section of the documentation here:
  
http://www.qnx.com/developers/docs/6.5.0_sp1/topic/com.qnx.doc.qdb_en_dev_g
uide/starting.html?cp=2_0_2

This will help you to start the qdb server.  When this is running you will
see your configured databases in /dev/qdb/ (use "ls /dev/qdb/" to see).
If you do not see /dev/qdb/ please confirm that qdb started successfully;
if you do not see your database name listed please confirm that it is
properly configured (start qdb with "-vvvvv" and check "sloginfo" for an
error messages).


If qdb is running you can use the qdb_*() APIs in an application to
interact with qdb; you can also use the command-line utility "qdbc".  Qdbc
is primarily used to run SQL statements on your database:
  
http://www.qnx.com/developers/docs/6.5.0_sp1/topic/com.qnx.doc.qdb_en_dev_g
uide/qdbc.html?cp=2_0_3



-- 
Ryan J. Allen
QNX Software Systems






On 13-05-19 9:08 PM, "Jian Rong Yong" <community-noreply@qnx.com> wrote:

>Hi,
>i have read about the qdb server under the help section and i have no
>clue on how to interact with it. Also when i use qdb_connect() to connect
>to the database, it replied with a "No such path or directory".
>please advise.
>
>Thanks,
>Jian Rong

Re: QDB server & database not found  
The reference example not real specific, but you need create file /db/customerdb.cfg as the text between dashes-

-------
[customerdb]
Filename=/db/customerdb

Schema File=/db/customerdb.sql

/db/customerdb.sql:

CREATE TABLE customers(
   custoemrid INTEGER PRIMARY KEY AUTOINCREMENT,
   firstname TEXT,
   lastname TEXT
)
-------

Then start qdb as... 

# qdb -c /db/qdb.cfg -vvvvvv -otempstore=/tmp -Rauto -A

If it succeeds, you should see...
QDB: created missing database customerdb

and /dev/qdb/customerdb will exist.

Re: QDB server & database not found  
Hi,

i tried starting qdb following the instruction under the help section but it replies me with a "Idd:FATAL: Could not 
load library libsqlite3.so.1".  Any advise on how to fix this error?

Thanks,
Jian Rong
RE: QDB server & database not found  
It's looking for libsqlite3.so.1 in your LD_LIBRARY_PATH .  On my QNX650 HOST for some reason it is not in the /usr/lib 
directory...but you can find it in QNX_TARGET.

thor$ uname -a  
QNX thor 6.5.0 2010/07/09-14:44:03EDT x86pc x86
thor$ which qdb
/usr/sbin/qdb
thor$ objdump -x /usr/sbin/qdb | grep NEEDED
  NEEDED               libsqlite3.so.1
  NEEDED               libz.so.2
  NEEDED               libc.so.3
thor$ which -sa libsqlite3.so.1
which: no libsqlite3.so.1 in :/proc/boot:/lib:/usr/lib:/lib/dll:/opt/lib:/usr/photon/lib:/usr/photon/dll:/usr/local/lib:
/opt/X11R6/lib:/usr/X11R6/lib:/proc/boot
:/lib:/usr/lib:/lib/dll:/opt/lib
thor$ qdb
ldd:FATAL: Could not load library libsqlite3.so.1
thor$ find /usr -name "libsql*"
/usr/qnx650/target/qnx6/ppcbe-spe/usr/lib/libsqlite3.so
/usr/qnx650/target/qnx6/ppcbe-spe/usr/lib/libsqlite3.so.1
/usr/qnx650/target/qnx6/ppcbe/usr/lib/libsqlite3.so
/usr/qnx650/target/qnx6/ppcbe/usr/lib/libsqlite3.so.1
/usr/qnx650/target/qnx6/x86/usr/lib/libsqlite3.so
/usr/qnx650/target/qnx6/x86/usr/lib/libsqlite3.so.1
/usr/qnx650/target/qnx6/armle-v7/usr/lib/libsqlite3.so
/usr/qnx650/target/qnx6/armle-v7/usr/lib/libsqlite3.so.1
/usr/qnx650/target/qnx6/armle/usr/lib/libsqlite3.so
/usr/qnx650/target/qnx6/armle/usr/lib/libsqlite3.so.1
/usr/qnx650/target/qnx6/shle/usr/lib/libsqlite3.so
/usr/qnx650/target/qnx6/shle/usr/lib/libsqlite3.so.1

thor$ ls -l */usr/lib/libsqlite3.so*
ls: No such file or directory (*/usr/lib/libsqlite3.so*)
thor$ use -i /usr/qnx650/target/qnx6/x86/usr/lib/libsqlite3.so.1
NAME=libsqlite3.so
DESCRIPTION=SQLite Library
DATE=2010/07/09-13:23:07-EDT
STATE=stable
HOST=mainbuild
USER=builder
VERSION=6.5.0
TAGID=89

thor$ echo $QNX_TARGET                
/usr/qnx650/target/qnx6
thor$ echo $LD_LIBRARY_PATH
:/proc/boot:/lib:/usr/lib:/lib/dll:/opt/lib:/usr/photon/lib:/usr/photon/dll:/usr/local/lib:/opt/X11R6/lib:/usr/X11R6/lib

thor$ which -sa libsqlite3.so.1
which: no libsqlite3.so.1 in :/proc/boot:/lib:/usr/lib:/lib/dll:/opt/lib:/usr/photon/lib:/usr/photon/dll:/usr/local/l
ib:/opt/X11R6/lib:/usr/X11R6/lib:/usr/qnx650/target/qnx6/usr/lib:/proc/boot:/lib:/usr/lib:/lib/dll:/opt/lib
thor$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/qnx650/target/qnx6/x86/usr/lib
thor$ which -sa libsqlite3.so.1                                                   
/usr/qnx650/target/qnx6/x86/usr/lib/libsqlite3.so.1
thor$ qdb                                                                         
qdb: must be superuser to start server

-----Original Message-----
From: Jian Rong Yong [mailto:community-noreply@qnx.com] 
Sent: May-26-13 9:49 PM
To: ostech-core_os
Subject: Re: QDB server & database not found

Hi,

i tried starting qdb following the instruction under the help section but it replies me with a "Idd:FATAL: Could not 
load library libsqlite3.so.1".  Any advise on how to fix this error?

Thanks,
Jian Rong



_______________________________________________

OSTech
http://community.qnx.com/sf/go/post101698
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com