I have developed a Java database application that has been deployed to users via a web server. Now, all is good but it has been requested that some of our external clients would also like access to the software. Is there any way that I can make the application work for these clients? The application has been put on another web sever that is accessible for external users and also has visibility to our SQL server but the application is not working, it will load in the browser but users cannot login to the system which works by database authentication. Am I missing something simple here or is this something that can't be done. I would imagine the latter since I think the web start application downloads to users machines which would explain why you can only login when a VPN connection is active.
Any help on this matter would be greatly appreciated.
Most definitely your firewall blocks the connections to your database when they are initiated from the outside. This is a good thing because you generally don't want to expose a database to the Internet.
One hacky way to do it would be to implement some kind of JDBC over HTTP to tunnel the database requests. Basically you'd use a JDBC driver that redirects the SQL requests to a web server.
A better way would be to refactor your code (I presume that would be a lot of work though...)
If you manage to abstract the data access layer, you can replace it by something more suitable for a web access, for instance a Web Service.
Finally a drastic option is to transform your client/database application into a webapp.
Related
I have developed a Rest webservice using JERSEY. WIth connects with the oracle database. I have JDBC connection code in my code itself, like the url, IP and username and password. Is is really required to again to configure the database connection on the server? like giving a JNDI name etc. Please help.
Thanks in advance.
Is it really required to again configure
No. It is not required to configure the database on the server, giving it a JNDI name and so forth.
Having said that, JavaEE best practices call for design whereby an application doesn't know the specifics of how to connect to external resources (such as databases). Instead, the application should "look up" that external resource by a logical name, and receives an object through which data can be accessed.
The main benefit in that is that your application code can focus on application functionality, while the application serving environment can take care of low-level aspects such as connection pooling, statement caching and so forth.
The other benefit of following this paradigm is that your application becomes immune to changes in the location of the database: no need to recompile your code, or re-package your application, in order to refer to a different data source. Instead, you could change the data source definition in the application serving environment so it points to a different location, and you're good to go.
I'm developing a desktop application in JavaFX with login system and some data that must be saved in a remote database. The question is: What it's the best way to stablish a database connection with each user with the server? Should I use a RESTful API or connect to database using the remote host just like if it was a local DB?
What kind of data are you looking to manipulate? Depending on exactly how much control you may need over the information (and how secure it must be?) if you don't need an absolutely synchronized view of the information (re: the server side app having a persistent connection to the client which is informed on change events and such) it may be best to just build up a RESTful API to do all of your grunt work between the two.
If you're coming to the RESTful api and also have to design it I suggest giving this a good read. Best Practices for a Pragmatic RESTful API
I am using Jboss server. Whenever trying to restart server my application is getting logged out. I wont allow user to logout until Log off the applicaion. How to manage this thing. Like gmail i need to do.
You can do it by HA Web Sessions via Database Persistence.
The basic use case we hear for this is environments where sessions need to be available to AS instances located across a WAN. JBoss Cache/JGroups clusters can span a WAN but often users find it impractical to configure their cluster(s) in that way. However, their IT infrastructure already supports making RDBMS data accessible across the WAN. So, persisting sessions to the DB makes them available across the WAN.
For more details visit here
We are having website which is hosted in real time server
we have developed a swing application through which we are connecting our remote database of our website .This application also provides feature to upload files to our website from the system like picassa software.Now we are planing to place this application in our website so that others can download and use it.
If I do like that others may extract my .exe file to jar file.May see the property file and can get database and ftp client passwords.So how should I provide security for my property file.
How softwares like picassa is protecting their passwords from us.
Please give an idea about these questions so that we can further proceed.
Thanks in advance ,
Does your website with the remote database have an application server that is serving the web content? If not, what is the database for?
If so, you should write a REST service or web service that the Swing application communicates with, so that all database connections are made from the application server to the database, not from your Swing application directly to the database. This has multiple benefits: apart from security, which you have already outlined, there is much less latency between the application server and the database than between your Swing application and the database. Furthermore, it gives you the opportunity to encapsulate business logic on the server and reuse code from your web application, thus extracting it from the Swing application.
Of course, you then need to secure the service itself. To do that, you can use a user authentication system like Spring Security to ensure that only certain users can access your service. This typically takes the form of a login API that establishes an ephemeral session token, and then all subsequent requests to the service supply that token to the service in a header (SOAP header, HTTP header, whatever).
For the FTP requirement, you could do this on the service side as well, although you would be transferring potentially large files to your server just to upload them to an FTP site. Alternatively, if feasible, you could have different usernames and passwords for your different users, and make then enter their credentials before being able to FTP their content. Then there is no shared FTP password and you do not have to worry about exposing it.
Sometimes we deploy applications behind customer firewall and we need read only access to their DB for debugging issues as sometimes their IT people are not SQL savvy. We want to bundle our application with some web based application that will expose the database and allow us to fire adhoc SQL queries and show their output in HTML table. We dont want to write home grown code and we can bundle Java/JSP based applications.
Our backend is Oracle so we need a solution that can connect to oracle server and expose it over the web.
If you want the database behind a firewall, and believe me, you do want your database behind a firewall, see if you can have a VPN for going directly into the box. Once you are on the VPN, you can use whichever management tool you currently use for managing the database. So if you use SQL Server, you can connect via the VPN, and use Enterprise Manager to manage the database. Oracle probably has a similar tool, although I'm not that familiar. While having a VPN does incur an extra cost, it will probably make things many times easier.
phpMyAdmin is a good favourite if you're using MySQL. Its always a bit dangerous opening up an application like that if the db is intended to live behind a firewall, but as you say you could set it up ith a read-only account and possibly add extra layers of security on top like simple HTTP Basic auth.
Oracle Tool is a pretty decent oracle web front end. But so is enterprise manager.
Either way, you don't want your database open to the outside world in any way, either via some website or a listener or anything really.
The VPN solution is the way to go, just get VPN and then you can use whatever tools you normally use, if VPN is not an option then a simple firewall rule allowing just your IP's access would be ok, but not quite as nice as VPN.
On my current project, we use SQL Navigator in order to run queries on our Oracle database. I've also heard decent things about TOAD. I would advise against writing a web application just to run ad hoc SQL queries, because it seems to me that plenty of tools can support your debugging needs.