Page 1 of 1

SFML Network Package

Posted: Sun Jun 28, 2009 6:48 pm
by Daxtorax
I have attempted to learn how to use the networking package for SFML, from sfml-dev.org, but I didn't quite understand how you would connect to say, a MySQL database. I have worked with PHP and MySQL, but I was wanting to access the database from my program. I was hoping someone here has used it for that before? I'm just using C++ (using Code::Blocks), any help would be greatly appreciated.

Re: SFML Network Package

Posted: Sun Jun 28, 2009 7:37 pm
by wacko
well I would just use MySQL C api or the C++ wrapper as it will provide you what your looking for if you app needs to connect to MySQL.

http://dev.mysql.com/doc/refman/5.0/en/ ... splus.html

Re: SFML Network Package

Posted: Tue Jul 07, 2009 5:57 pm
by Ginto8
Just so you know, and I don't like to recommend this language because it's nowhere near as efficient as C/++, but if you want to access an SQL database, I've heard that Java is really good for it.

Re: SFML Network Package

Posted: Tue Jul 07, 2009 7:07 pm
by wearymemory
Ginto8 wrote:Just so you know, and I don't like to recommend this language because it's nowhere near as efficient as C/++, but if you want to access an SQL database, I've heard that Java is really good for it.
I don't think efficient is the word. Java is highly efficient, and in some areas, it is a lot more efficient than C++. And the OP said he was just using C++.

Re: SFML Network Package

Posted: Tue Jul 07, 2009 8:04 pm
by Ginto8
wearymemory wrote:
Ginto8 wrote:Just so you know, and I don't like to recommend this language because it's nowhere near as efficient as C/++, but if you want to access an SQL database, I've heard that Java is really good for it.
I don't think efficient is the word. Java is highly efficient, and in some areas, it is a lot more efficient than C++. And the OP said he was just using C++.
Yes I was just pointing out that Java may be a better option for SQL access.

Re: SFML Network Package

Posted: Tue Jul 07, 2009 8:23 pm
by wearymemory
Ginto8 wrote:
wearymemory wrote:
Ginto8 wrote:Just so you know, and I don't like to recommend this language because it's nowhere near as efficient as C/++, but if you want to access an SQL database, I've heard that Java is really good for it.
I don't think efficient is the word. Java is highly efficient, and in some areas, it is a lot more efficient than C++. And the OP said he was just using C++.
Yes I was just pointing out that Java may be a better option for SQL access.
Yes, but after you said it was nowhere near as efficient as C/++.

Re: SFML Network Package

Posted: Wed Jul 08, 2009 12:32 pm
by Ginto8
wearymemory wrote:
Ginto8 wrote:
wearymemory wrote:
Ginto8 wrote:Just so you know, and I don't like to recommend this language because it's nowhere near as efficient as C/++, but if you want to access an SQL database, I've heard that Java is really good for it.
I don't think efficient is the word. Java is highly efficient, and in some areas, it is a lot more efficient than C++. And the OP said he was just using C++.
Yes I was just pointing out that Java may be a better option for SQL access.
Yes, but after you said it was nowhere near as efficient as C/++.
Java, if not as efficient as C/++, has built-in SQL access functions that may, in actuality, be more efficient than access libraries for C/++. And if not as efficient, easier to use. Bear in mind that my opinion of Java's efficiency in comparison to C/++ mainly lies in the fact that it is interpreted. Imagine EVERY program being run in Wine. That's what a Java-based system is like.

Re: SFML Network Package

Posted: Wed Jul 08, 2009 12:42 pm
by programmerinprogress
well Java zealots would argue that Java isn't strictly 'interpreted', it's compiled into bytecode for the virtual machine and then executed as if it were machine code, through the virtual machine... but i'm not a zealot, it's interpreted dammit! :lol:

yeah, I mean efficiency is measured by more than execution time, if something is harder to obtain, and program for, then surely it could be classes as less 'efficient'

you could also argue that such a tool could be deployed better in Java, since it could be integrated into a web browser, which anyone could use with an internet connection, as opposed to a program written in C++ which is bound to it's intended platform.

These are all things to take into consideration, in this case, I agree with Ginto8, the avilability of an SQL library would probably simplfy development.

Re: SFML Network Package

Posted: Wed Jul 08, 2009 1:54 pm
by wearymemory
Ginto8 wrote: Java, if not as efficient as C/++, has built-in SQL access functions that may, in actuality, be more efficient than access libraries for C/++. And if not as efficient, easier to use. Bear in mind that my opinion of Java's efficiency in comparison to C/++ mainly lies in the fact that it is interpreted. Imagine EVERY program being run in Wine. That's what a Java-based system is like.
Perhaps you have a misunderstanding of the word "efficient," or your previous sentences didn't make any sense.
Java is extremely efficient, especially with showing desired effects with very little effort (if you have a working knowledge of it), and one of the things that adds to its efficiency is it ability to run on almost every platform without having to recompile it for that platform, and this is because it is interpreted. So you're saying C++ is more efficient than Java because Java is interpreted?

Re: SFML Network Package

Posted: Fri Jul 10, 2009 7:17 pm
by short
I am pretty sure he was speaking purely about execution time. The opinion that c/c++ is faster then java in pure execution time is not always true.

I mean just last semester I was able to make a simple c program run faster then an assembly program my professor had written. It all comes down to what each language is good at.

(All right, after we wrote the c equivalent program we were given the task to make the professors assembly code execute faster then the c equivalent we had written, which I eventually did. It took a lot of research, reading, and low level understanding to do this, which the argument to that higher level languages offer faster development speed and thus more efficient).

I realize that you guys are debating c/c++ and java, but I think it was a good extreme example to demonstrate that you are both correct, in different ways. More efficient can be interpreted multiple ways, other then pure execution time OR development speed time.

Re: SFML Network Package

Posted: Fri Jul 10, 2009 7:26 pm
by programmerinprogress
I couldn't put it better myself :lol:

Re: SFML Network Package

Posted: Sun Jul 12, 2009 10:44 am
by dandymcgee
@short0014 - That's a pretty awesome assignment too. You stand to learn a lot from simple stuff like that. :)