Archived

This topic is now archived and is closed to further replies.

Cygnus_X

Java and Sql on the Web

Recommended Posts

Ok, I''ve resisted posting for some time now.... but I''m out of options and I could use some help. My background is in Visual Basic, but I''m trying to write a text-based MMO and it seems that useing Java and Sql (which isn''t exactally up my ally) would be most pratical. The problem is, I''ve concluded that I''m going to have to let users manipulate a database on a server (there is simply too much data to handle otherwise)...... and I don''t know how to do that. I''m familiar with Java''s JDBC commands where you can call a database and even modify it, but I can''t imagine that working for what I''m trying to do. Its almost like you''d have to let users obtain an FTP connection or something of the like.... I know java has the whole sockets thing where you can connect to a port, but does anyone have a good tutorial that deals with this stuff? I''m also interested in building a ''user login'' function where you type in your user name and password, press submit, and you''ll get loged in (I know there has to be open source code out there somewhere for that). Anyways, thanks in advance.

Share this post


Link to post
Share on other sites
it isn''t a good idea to let users touch the database, as they can (and therefore eventually will) screw it up royally. plus, a database won''t be very fast for handling the entire game.

it would be better to write a server program that the users connect to, and the server can deal with the database (for loading/saving characters, and all that good stuff).

Share this post


Link to post
Share on other sites
Well, the idea was to have some sort of code to handle user input.... ie, you type in a number, press submit, and the code manipulates the database from there. I can write that sort of thing on my own computer (in VB and Access, its a cake walk).... but to put the database on a server and still let it be accessable/writeable (not just read only) is the tricky part. I''m not even quite sure where to begin.... theoretically, the server I''m useing supports Java, and since Java can manipulate an SQL database, I wouldn''t ''need'' to run any sort of special SQL software ... But this is really out of my knowledge range.... any ideas?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You need to run a database on the server, and have appropiate JDBC libraries installed. Your application will be client-server, so the users will be running a Java application locally, which talks sockets to a Java server, which handles all game logic etc. The server application will have appropiate permissions and configuration to allow it to use JDBC to access the database, so can use the data to process user input and generate output.

The client application will either be a downloadable application or an applet (if the game server is the same box as a web server), or even better a WebStart application.

Don''t try an access a database directly from a client application - it''s not only a Bad Idea from design and security standpoints, but JDBC traffic is unlikely to get through the server''s firewall.

--cfmdobbie

Share this post


Link to post
Share on other sites