christian wrote:
Security can not be created by obscurity. You need a system based on stored procedures and/or tight permissions on the database server, that's all. No layer of complexity you add in front of this is going to change this fact.
I totally agree with you about that, but the goal of my application is to allow the final user to install it easily on its own "hosting space", whether it's a php or an asp webspace has to be transparent for the user. The database type has to be transparent as well.
Ideally, my user would do those steps :
INSTALLATION :
1) Download the application named "Installation" of my application, which is an heavy client.
2) Use that heavy client to connect to the database, and in that heavy client, inform about what kind of database is used, about the ip/host, login and password to it. Also inform about what kind of web scripting is used ( let's say PHP ).
3) Click the install button, and my "Installation" heavy client would create all the needed tables for my application. Those tables are the ones mapped in hibernate.
4) My "Installation" application would also create a page ( coded in the language of the web scripting language chosen in step 2 ) with the required login/pass and ip infos. Let's name that page "myapplication.php".
5) Final step to finish the installation is to upload that page.
EXPLOITATION :
1) Download the application named "Client" of my application, which is an heavy client.
2) Simply connect with it to the "myapplication.php" url. Use a login/pass for administering rights. Only the URL matters here, unlike the "Installation" part. All queries are done with hibernate generating the right SQL and there is no information on the client about _how_ to connect to the database, or even _where_ the database could be.
An important thing to note is that I plan on making my "Client" application able to connect to multiple servers. Let's say you can provide as many URLs as you wish, by a "Favorites" like system.
I hope my goal is clearer like this, and that you understand my concern about making my application communicate though a "layer" coded in another language than Java.
If you can give me a hint, or whatever, I'll gladly take it ! I will already check about what I can do with implementing a java.sql.Connection, but I guess I'd have to learn a lot about Hibernate internals to make it work..