Hello, I am about to start a new project and any feedback would be appreciated on it.
I am creating a client-based application that will be accessing a database on a remote web server. It needs to run on any OS. What programming language would be best fit for this and what type of database should I store my data in on the web server? I would personally prefer using a mySQL database, since I will also be accessing it with PHP scripts on a web server.
Thank you in advance for any help/suggestions.
Steph
OS-independant client program to communicate with web server database
Started by steph03, Aug 20 2010 07:18 AM
6 replies to this topic
#1
Posted 20 August 2010 - 07:18 AM
|
|
|
#2
Posted 20 August 2010 - 07:55 AM
C++ is a good cross-OS compatible language which can run on UNIX (HP-UX, IRIX, ...), Linux, OSX and Windows. What you will need to do is ensure the MySQL database allows remote connections, I'll whip up a quick example of a client for you..
Info sheets: MySQL :: MySQL 5.0 Reference Manual :: 20.8 MySQL C API
#include <iostream>
#include <my_global.h>
#include <mysql.h>
using namespace std;
int main(int argc, char **argv)
{
MYSQL *conn;
conn = mysql_init(NULL);
if (conn == NULL) {
printf("Error %u: %s\n", mysql_errno(conn), mysql_error(conn));
}
if (mysql_real_connect(conn, "mysqlwebhost", "user", "password", "database", 0, NULL, 0) == NULL) {
printf("Error %u: %s\n", mysql_errno(conn), mysql_error(conn));
}
if (mysql_query(conn, "foo query")) {
printf("Error %u: %s\n", mysql_errno(conn), mysql_error(conn));
}
mysql_close(conn);
}the MySQL headers should come with the official MySQL package (for example be in /usr/include/mysql/mysql.h)Info sheets: MySQL :: MySQL 5.0 Reference Manual :: 20.8 MySQL C API
Edited by Alexander, 20 August 2010 - 08:47 AM.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#3
Posted 20 August 2010 - 10:13 AM
Thank you very much for the quick reply! It's been a while since I've programmed in C++, over 6-7 years. Has it become easier to program a GUI in C++? Will Visual Studios cut it ?
#4
Posted 20 August 2010 - 10:16 AM
Some new .NET frameworks came out but it's pretty much remained the same since '02, VC++ for winforms should bunker down nice with this project.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#5
Posted 20 August 2010 - 10:18 AM
Perfect, thanks again for the help. This will be a great starting point.
#6
Posted 25 August 2010 - 07:36 AM
Remember, even if using C++ if you use any part of the .NET Framework in your VC++ application it will not run on anything other than Windows so I would stick with native C++ and stay away from the .NET Framework (Boy from a C# developer that was hard to say lol). Another option you have is Java, which will run on the OS's you listed, and Java may be easier when working with the GUI.


Sign In
Create Account

Back to top










