How to change setting to access my SQLite database remotely - sqlite

I'm trying to set up a POS system on two pc locally
Please how do i change this setting to connect and save to the database remotely ?
db_host localhost
db_hostaddr 127.0.0.1
db_name pos
db_password 123
db_port 5432
db_user postgres
db_driver SQLite
data_dir data
data_db pos_data.sdb
update_server 127.0.0.1
update_user max
update_pass 123

This 'config file' suggests there at least two different DBMSes involved: PostgreSQL and SQLite. Surely there is more to it. A SQLite DB fits in a standalone file (+ temporary files). The PostgreSQL instance is probably running locally, hence localhost/127.0.0.1.
There is not enough information on that POS system. Maybe it's an open source project and there is some documentation available, if it is a proprietary application, maybe there is still documentation, otherwise you have to check with the vendor. Perhaps the source code (if available) has some useful comments too...
Actually it's impossible to advise without knowing your network setup. It's not as easy as moving the database to another machine. You have to know the IP address or host name of the server, and there should be a firewall tuned to allow connections to the database server.
Probably, you change db_host and db_hostaddr, and test. But it's not clear what update_server is and what it does. Nor is it clear what each database (PostgreSQL and SQLite) contains and how the application is structured.
You need to provide a lot more information if you want help.

Related

Cannot Connect To PostgreSQL Database

I am trying to connect to my database through R, but am getting an error. My coworker connects perfectly with the same exact script. Anyone know what else could be the problem? We have the same packages installed.
PostgreSQL servers control who they listen and talk too. You did well comparing the same script between machines, but you may be coming from different subnets, or any other difference which would tickle this behaviour.
On my box, this is controlled by the file /etc/postgresql/9.1/main/pg_hba.conf -- hba stands for host-based access.
So you may have to talk to your DBA or sysadmin.

Connect to z/OS Mainframe with SFTP

We have a IBM Host System Z sitting in our cellar. Now the issue is that i have no clue about Mainframes!!! (It's not USS btw.)
The Problem: How can i transfer a file from the host system to a windows machine.
Usually on UNIX systems i would just install and ssh daemon and connect to it via. a program called winscp. After that transfer the file in binary so that it does not convert something (Ultraedit and other Editors can handle this).
With the host system it seems to be a bit difficult as the original format from IBM is EBCDIC and i have no idea if there is a state of the art SFTP server program for the host. Could anybody be so kind and enlighten me? From my current expirience with IT there must be a state of the art sftp connection to that system? I appreciate any help/hints/solutions.
Thank you,
O.S
If the mainframe "sitting in [your] cellar" is running z/OS then it has Unix System Services installed. You can't have z/OS without it.
There is an SFTP package available (for free) for z/OS.
You can test to see about Unix System Services by firing up a 3270 emulator going to ISPF option 3.17, putting a forward slash (/) in the Pathname field and pressing the mainframe Enter key. Another way would be to key OMVS at a TSO READY prompt, which will start up a 3270-based Unix shell.
It is possible that USS is simply not available to you; if you're running any supported release of z/OS then USS is present. There could be concerns about supporting something outside a particular group,
Or, depending on what OS you have running on your System z, it's possible you don't have z/OS. You could have z/VM, you could have zLinux, you could have TPF. However, if you're running zLinux, you have linux, which has sftp installed, and which uses ASCII, not EBCDIC.
As cschneid says, however, if you have z/OS, you have USS. TCP/IP, among other things, won't run without it. Also note that z/OS TCP/IP has an FTP server, so you can connect that way if the FTP server is set up. If security is an issue, FTPS is supported, although it's painful to set up. With the native FTP server, you can convert from EBCDIC to ASCII when you're doing the transfer. There's also an NFS server available. And SMB as well, I believe.
And there's an FTP client available as well, so you could FTP from z/OS to your system, if you wanted to.
Maybe a better thing to do would explain what you're trying to do with the data, and what the data is, in general. You can edit files directly on the mainframe, using either TSO, ISPF, or OMVS editors. There are a lot of data types that the mainframe supports that you're not going to be able to handle on a non-z system unless you go through an export process. I'm not really clear on whether you want to convert the file to ASCII when you transfer it or not.
While the others are correct that all recent releases of z/OS have USS built-in, there's quite a bit of setup work that needs to be done in order for individual users to have access to USS capabilities like SFTP. Out of the box, you get USS "minimal mode" that just has enough of USS to support the TCP/IP stack and so forth. USS "full function mode" requires setup:
HFS filesystems need to be allocated
Your security package needs to be manage UIDs/GIDs for your users
etc etc etc
Still, with these details and with nothing more than the software you're entitled to as part of your z/OS license, you can certainly run SFTP and all the other UNIX style network services you're used to.
A good place to start is the UNIX Services Planning guide: http://publibz.boulder.ibm.com/epubs/pdf/bpxzb2c0.pdf

Should you use ODBC or Registry Entry for data connections?

I support a group of developers that are telling me to setup a registry entry for an application that they made in asp.net to connect to our SQL backend. Would it not be better to do this from an ODBC connection? Is this lazy programming or is this common practice?
If all their connections are in registry entries how will I be able to spin up the DRP site in case we have an issue? Right now we replicate the content across and it would be a heck of a lot easier if the DB connections were in ODBC instead of having to redo all these registry entries. (there are multiple apps doing this).
Please fill me in. Thanks
Why are they not using the web.config to store connection strings? http://msdn.microsoft.com/en-us/library/ms178411.aspx

SqLite3 NFS mount issue with locking - can I use something like CIFS nobrl?

I'm having a locking problem where an SQLITE3 databse is permanently locked when created on an NFS file system. I have read that an option called nobrl can help this issue when the file system in question is CIFS. (its an option to the mount command).
From: http://linux.die.net/man/8/mount.cifs
nobrl
Do not send byte range lock requests to the server. This is
necessary for certain applications that break with cifs style
mandatory byte range locks (and most cifs servers do not yet support
requesting advisory byte range locks).
Is there any way to stop byte-range-lock requests in NFS if they occur, or am I running in the wrong direction by even thinking about this? I'm happy to change the mount command as was done for the CIFS solution.
I recommend to open you sqlite db by software with nolock parameter enabled, golang exg.:
sql.Open("sqlite3", "file:/media/R/Databases//your.db?nolock=1")
while /media/R is a mounted windows nfs-network-drive. Be carefull because you have to lock your db interactions by software otherwise you could corrupt your db, when accessing it simultaneously.
You can read more about sqlite parameters here:
https://www.sqlite.org/c3ref/open.html

mysql odbc questions

i'd like to use the mysql odbc driver for connecting to my mysql database via my own app.
the problem is that it seems very unstable - i keep getting errors like:
[MySQL][ODBC 5.1 Driver][mysqld-5.5.8]MySQL server has gone away
it seems to be something like a session timeout.
so here's my questions:
- what is causing those errors?
- is there a way to fix it for getting stable connections?
- is it recommended at all using it for coding windows software?
thanks
My guess is you're opening the connection once and leaving it open. At some point, the connection either times out, or some network hiccup is causing the connection to be invalid/closed. The best way to do database access is to open the connection when you need to do work, then close it. Or, alternatively, change your code to support re-connecting when you encounter an error.
Based on discussion in the comments below, I would suggest dumping the access database to a csv file, then using something like PHPMySql to import the data into MySQL.
You can use the BigDump tool to import large databases dumps into MySQL. (via this site)
There are commercial alternatives out there -
OpenLink Single-tier ODBC Driver for MySQL

Resources