JDBC MYSQL localhost vs. over the internet

I am new to java so please take it easy on me. I have a little bit of a crisis here and want to make sure I understand what it is that I am trying to accomplish.
I have a Java application that I want people to run from their machine that access my web server over the internet and connects to my MYSQL database. It uses webstart to download application to their machine where they run it locally. Here is how I have this setup. Is this not a standard practice? Or should I have used a different Java technology to have them run the application directly from my server using localhost instead of mywebsite?
So, am I using java in a practical way using mywebsite.com:3306 and the user running it locally on their machine. Or do I have to set this up so they run in on my server using localhost?
try
               String userName = "testuser";
               String password = "testpass";
               String url = "jdbc:mysql://mywebsite.com:3306/test";
               Class.forName ("com.mysql.jdbc.Driver").newInstance ();
               conn = DriverManager.getConnection (url, userName, password);
               System.out.println ("Database connection established");
           catch (Exception e)
               System.err.println ("Cannot connect to database server");
           }Edited by: crusherdestroyer on Jan 20, 2010 10:28 AM
Edited by: crusherdestroyer on Jan 20, 2010 10:29 AM

Good evening, CD.
As the others have said, you should not have your SQL server exposed to the public. If you use ACLs or similar and allow only trusted hosts to access your MySQL server, you should be fine to continue as-is (Java client connecting to TCP port 3306 of your server if I understand your explanation correctly.) If you want to convert your simple application to a server-side app, you could also use something like procrun if your server is running Windows or jsvc for UNIX/Linux. This will enable you to run your app as a service/daemon and you could configure it to listen on an arbitrary port for incoming connections and use the app as an intermediary for interfacing connecting clients with your MySQL database. This is just another idea opposed to installing and configuring Tomcat, Jetty, or the like and possibly a webserver in front of that.
Regards,
Lloyd Dilley

Similar Messages

  • "jdbc:mysql:///test" - "jdbc:mysql:test" what is the difference

    "jdbc:mysql:///test" -> "jdbc:mysql:test" what is the difference:
    I used both of them in my url but only "jdbc:mysql:///test" worked only
    what is the difference what /// means?

    JDBC URLs have the format
    jdbc:<subprotocol>://<data source identifier>
    jdbc indicates a JDBC data source. subprotocol identifies which JDBC Driver to use.
    For com.mysql.jdbc.Driver and localhost server, database name as 'test':
    it's jdbc:mysql://localhost/test
    or jdbc:mysql://127.0.0.1:3306/test
    you would select another server and database name.
    For sun.jdbc.odbc.JdbcOdbcDriver with MS Access or SQLServer database, it's jdbc:odbc:DSNname
    HTH

  • Saving an Image to an Oracle Database over the Internet

    I would like to know how to transfer an image over the Internet and save that image to an Oracle Database. That is I am trying to make it so that a user can connect to the Internet and select an image file form their PC in TIFF, JPEG, or some other format. Next, I would like to save this image to an Oracle 7.3.4 Database in a LongRaw data type. This image will need to be save into a certain record in a table that I created. In the next few months we will be upgrading to Oracle 8 that uses Blob data type. Any one who knows how this can be done, please let me know.

    Yes, that's right. Here is the pertinent code:
    In the flax app:
    private function captureImg(imgEnc:IImageEncoder):void { 
    var ohSnap:ImageSnapshot;ohSnap = ImageSnapshot.captureImage(img, 0, imgEnc);
    textArea.text = ImageSnapshot.encodeImageAsBase64(ohSnap);
    InsertImage(textArea.text);
    In the HTTP service AS module:
    private  
    function InsertImage(sImageCoded:String):void { var sQry:String;sQry =  
    "INSERT INTO image (lImageId, blbBitMap, txtImage, lRecipeId) " sQry +=
    "VALUES(0, '" +sImageCoded +"', 'text', 23)"  
    //Alert.show(sQry);mysqlQuery(sQry,
    "InsertImage");}
    As mentioned previously, an HTTPrequest error is generated although I can enter
    the string into the blob manually in MySQL.
    Scott

  • QMASTER server visable over the internet

    So what I wan't to do is be able to setup a cluster of computers just for rendering and be able to have people outside of my network upload scripts to this cluster. Specifically SHAKE scripts.
    I have read through any information I could find on how to configure a Qmaster Server to be accessable outside of a local network, but nothing showed me how to do it. I just want to make sure its possible.
    Thanks.

    Gunjack wrote:
    Heya,
    I have massive gaps in my knowledge, I can happily write java programs using server sockets and get them connecting to stuff on a local network... but I have absolutely no idea how I can make it so that I can connect to it over the internet :S The Java code is exactly the same. The only thing that's different is instead of passing "127.0.0.1" or "192.168.1.2" as the host address, you pass the public IP address of the host you're connecting to.
    How do you do that? Ive got my servers and clients all connecting to localhost at the moment, how can i get it to work online? I dont imagine that I can just run the server codes on my pc and enter something other than localhost to make it connect from outside the network...can I?If you want somebody from outside your local home network to be able to connect to your server, you have to give them a public IP address. If your server is connected directly to your cable modem or DSL modem, then it may or may not have a public IP address.
    If your server is behind your own router (and also for some cases connected directly to the modem), you'll have to configure NAT on the router. (How you do that is specific to your router, and should be in its docs. Most home routers have a web interface for administration.) Set router to forward some port on its WAN side to some port (usually the same port, but doesn't have to be) on your server. The client connects to the public IP of the router, which then forwards it to your server.
    Either way, it will only work if your ISP allows incoming connections to that port on your public IP address.
    [http://en.wikipedia.org/wiki/Network_address_translation]
    [http://en.wikipedia.org/wiki/Private_ip_address]
    Edited by: jverd on Jan 27, 2010 12:37 PM

  • How do I backup my time capsule to another time capsule over the internet

    I have a Time Capsule that I use for backups locally within my own home. My parents have one as well that they use for their backups. Ideally it would be great to have my backups offsite -- if your house burns down it doesn't help that your backups were in the house...
    So is there a way to copy (automatically) the image from one TC to another and vice versa over the internet?

    No, there isn't, and even if there was, it would take forever, or possibly longer. 
    Any backup done over the internet will be quite slow; upload speeds are generally much, much slower than download speeds.  Some of the companies that do internet backups, such as Mozy, Carbonite, etc., actually ship you an external HD for the first backup.  You ship that back, they load it onto their servers, then do "incremental" backups of what's changed over the net.
    In addition, it's not a good idea to back up a backup; any problem with the original will be copied to, and perhaps magnified, on the copy. 
    A much better approach is to get a portable external HD; do backups to it, then take it to a secure off-site location.  See #27 in Time Machine - Frequently Asked Questions for some suggestions, especially the pink box there.
    It still might be a good idea to have some limited data backed-up over the internet, such as relatively-small things and/or things that rarely change.

  • How do I access my time capsule over the internet

    How do I access my time capsule over the internet. I've already set it up to share over WAN, but I have ATT so my TC is connected to the router provided by ATT can I still access my TC via the internet even though its not directly connected to the Ethernet?

    The TC should be in bridge mode.. not setup to share over wan.. that will never work. That is assuming you haven't bridged the ATT router.
    Once you bridge the TC see if you can setup BTMM using icloud settings in the TC. As per the Apple docos.. here.
    You should also be able to directly access the TC since you have a router with dyndns client at a guess.. the setup is simply forward port 548 to the TC.
    Google search this.. there is huge number of resources available. eg
    http://useranswer.com/answer/how-can-i-access-my-time-capsule-remotely-with-iclo ud/

  • Can not view video over the Internet on WVC80N

    I set up the web cam, set up the port forward etc so now I am able to:
       1. view/change web cam settings inside my home network.
       2. view video inside my home network.
       3. view/change web cam settings over the Internet.
    But I am not able to view video over Internet. Every time I did so (using IE browser), after clicking the view video button, I got an error : There are too many user connections or the device is busy, please try again latter.
    Anyone has a fix on this? I set up port forwarding on port 1024 (that's how I can chage settings over Internet).
    I spent 2 hours on the phone with Linksys tech support but they could not find the reason.
    Thanks,
    Sam

    Who is your ISP? How you are trying to access your Camera from the remote location? Along with Port 1024 you need to do port forwarding for port 80 on your router for the Cameras IP address. As WVC80N works on your HTTP Port.
    To access your camera from the Remote location, you need to use http://wan ip:80.

  • Unable to see Dashboard over the internet (Portal)

    Dear All,
    I have one issue here which is bit technical,
    I have made an Xcelsius Dashboard (Connection Type: Excel XML Maps (BW Queries)) and uploaded SWF file on to KM Repository in Portal. I have created Document iview and a role to published the dashboard on Enterprise Portal.
    Now when i am trying to access that Dashboard from Portal within local network it works fine but when i try opening the same Dashboard over the internet from home it gives an error.
    ERROR DETAILS:
    To access external data, add a cross-domain policy file to the external data web server.
    For more information, on the Adobe website, see the article u201CCross-domain Policy File Specificationu201D.
    If the problem persists, contact the file creator or your system administrator.
    Error: Error #2048
    Connection Type: Excel XML Maps
    File URL: https://www.portal.com/irj/go/km/docs/documents/dashboards/dashboard1.swf
    External Data URL: http://bwserver.domain.com:8000/sap/bc/bsp/sap/zbo_data/Data.xml?infocube=ZFIGL_FM&query=ZFIGL_FM_Q0003_BO&VAR_NAME_1=0P_FYRA&VAR_VALUE_EXT_1=2009
    I have added crossdomain into WebAppl Srvr of BW Server .. Created BSP Application ---> Imported crossdomain file ---> set BSP App in Default Service.
    Please suggest me possible Solutions.

    Closing Thread

  • Unable to see Dashboard over the internet Using Enterprise Portal

    Dear All,
    I have one issue here which is bit technical,
    I have made an Xcelsius Dashboard (Connection Type: Excel XML Maps (BW Queries)) and uploaded SWF file on to KM Repository in Portal. I have created Document iview and a role to published the dashboard on Enterprise Portal.
    Now when i am trying to access that Dashboard from Portal within local network it works fine but when i try opening the same Dashboard over the internet from home it gives an error.
    ERROR DETAILS:
    To access external data, add a cross-domain policy file to the external data web server.
    For more information, on the Adobe website, see the article u201CCross-domain Policy File Specificationu201D.
    If the problem persists, contact the file creator or your system administrator.
    Error: Error #2048
    Connection Type: Excel XML Maps
    File URL: https://www.portal.com/irj/go/km/docs/documents/dashboards/dashboard1.swf
    External Data URL: http://bwserver.domain.com:8000/sap/bc/bsp/sap/zbo_data/Data.xml?infocube=ZFIGL_FM&query=ZFIGL_FM_Q0003_BO&VAR_NAME_1=0P_FYRA&VAR_VALUE_EXT_1=2009
    I have added crossdomain into WebAppl Srvr of BW Server .. Created BSP Application ---> Imported crossdomain file ---> set BSP App in Default Service.
    Please provide possible solutions

    We have the same problem.
    The Solution 1.
    http://wiki.sdn.sap.com/wiki/display/EmTech/Addcrossdomain.xmlontherootofSAPWebapplication+server
    and 2.
    http://www.asabau.com/2009/04/crossdomain-policy-file-in-sap-web-application-server/
    does not work.
    How you have fix it?
    regards
    Chris

  • How to share videos with family over the internet

    I have a ton of home videos that I have edited with Final Cut and I would like to find a way to share those with family and friends across the country. Is there any way to do this in the Apple ecosystem. If not, what do most recommend as the best way to do this? Thanks

    Thanks for the reply... I'm actually looking for something that would allow me to have all the content available in a library so friends and family can see all the content and then choose what to watch. Ideally, it would be like iTunes or iPhoto only that it could be accessed by multiple people from all over the internet. I think Apple is missing a huge niche in this area.

  • How do I use airport utillity with Time Capsule(or any airport extreme) over the internet without mobile me? iCloud has disabled this function?

    How do I connect to my Airports/time capsules over the internet using the mobileme function under icloud?

    i want to do the same. i tried entering my @me.com account and does not work, but if I tried to go to icloud.com and using my @me.com works
    why?
    does the Airport express needs to be upgraded as well

  • Access Time Capsule over the internet

    Hey guys! I have a problem. I cannot access my Time Capsule over the internet.
    I have a Time Capsule 2013 which connects to the internet using a PPPoE connection and which provides wireless connection to other peripherals in my house.
    The TC is running the latest firmware and I've added my iCloud account in AirPort Utility settings, in order to access the TC over the internet, via Back to My Mac.
    Whenever I'm away from home, I cannot access the TC.
    I see it in Finder's sidebar, but whenever I press the "Connect As.." button I get the following error:
    "There was a problem connecting to the server “Time Capsule”.
    The server may not exist or it is unavailable at this time. Check the server name or IP address, check your network connection, and then try again."
    I must add that I have a dynamic IP. Whenever the Time Capsule restarts, it gets a different IP.
    Am I missing something?
    Please help me. It's really important for me to be able to reach it when I'm away from home.

    So the modem is bridged and the TC is doing the PPPoE authentication.. and it gets a public IP on the WAN interface.
    The dynamic nature of the IP is not a problem with the BTMM and iCloud type system which should keep the intermediate connection in the cloud up to date.
    What about the connection at the other side.. are you getting a public IP.. are you behind a firewall or restricted access? Remember both sides of this have to work.
    See this thread.. you are not alone.. all is not sweetness and light unless you get a proper business account with static IP.
    https://discussions.apple.com/thread/3699096?start=0&tstart=0
    Apple info has a bit about issues that people experience.. and Tesserax has some setup info.
    Remote Access
    I would use the public IP and see if it works.. that means you need to check the IP before you leave home or use your phone tether and do the test at home so you can type in the public ip and use direct access .. at least to test it.

  • Time Capsule - how to gain "over-the-internet" access from Windows 7!

    Hi guys,
    I've been fighting for such a long time with my Time Capsule. I have no idea how to gain access "over-the-internet" on a PC (Windows 7) which is running on  another network. My Time Capsule is set up with my Macbook Pro at home running Lion OSX, and i have internet connection. My brother who also uses Macbook has no problems connecting to my Time Capsule - through finder (connect to a server). But how do I gain "over-the-internet" access to my Time Capsule through a PC (Windows 7) from my office? Is there please someone who can guide me step-by-step, how to gain connection to my TC through a PC? Or maybe just an explantaion what has to be done on the PC before this thing can work out! This was the main reason to why i bought Time Capsule - besides of the Time Machine function. I also have an iCloud account (earlier Mobile Me), if that makes any difference.
    Thanks!

    There is no way to do it from windows direct to the TC.
    It only presents AFP to the WAN side. And most ISP block SMB from internet access due to risks. There is AFAIK, no suitable AFP protocol utility for windows at the moment. If you google and find one, be aware it probably will not work to your satisfaction anyway.
    You must use a Mac to access AFP but even then it is not a secure protocol and I would recommend against it anyway.
    So basically if you had have asked before purchasing, I would have said, TC is unsuitable product. It is a backup drive for a Mac. It is not a NAS.. it is not designed for remote access by any computer other than a Mac. It does not support any other file protocol to the WAN interface.. and no secure protocol even there.
    A NAS with Time Machine extensions from QNAP, Synology, Netgear all are designed for web access and are far more suitable. Researching a purchase beforehand is always worthwhile.
    Anyway, your choices are.. return the TC and buy something more suited to the job.
    Or if return is now impossible sell the TC on ebay.. etc and do the same thing.. buy a more suitable NAS.
    Or buy a cheap mac mini (even second hand) and use that for communications with home.
    Or, replace your current router with something that includes vpn. This is actually a good and commercially sound decision. VPN is generally used by business to connect to remote locations, because it is secure and will allow the greatest flexibility of connection. How hard or easy depends on the current setup. I would recommend a combined modem router with vpn server if you have adsl. Or for cable you can find plenty of routers with combined vpn. You can also use those for adsl if your ISP allows pppoe with bridged modem. The TC will have to be bridged as well. For other broadband it might be harder to find the right kind of box.
    Once you setup a vpn you can access it from work using the appropiate vpn client in your work computer.

  • How can I download a file over the internet from a WebDAV server?

    I am trying to download a file over the internet from a WebDAV server. I've tried doing it with Datasocket as suggested in these articles,
    <a href="http://digital.ni.com/public.nsf/websearch/f3cc5f7e60a75cb2862567e700696abf?opendocument">Retrieving an Unformatted Text File via FTP or HTTP Using DataSocket</a>
    <a href="http://digital.ni.com/public.nsf/websearch/4FA09E7B3674DA34C1256BD400555C41?OpenDocument">Download a Text File from a Password Protected URL Using DataSocket</a>
    but all I get is error 1181 (protocol unrecognized by Datasocket).
    I know I have the URL correct, because I can put it into a web browser and it works fine - I can download the file manually.
    But I want to have a LabVIEW program do the download automatically.
    I have the internet toolkit, but don't have the foggiest clue how to use it, and am using LabVIEW 7.1
    I am a bit out of my depth here, so any advice welcome.
    Regards,
    Mark.

    MIG,
    What is the URL to the website? Is it an FTP site? The articles you referenced are for specific transfer protocols. If the stie you're trying to get to doesn't follow these protocols, then you'll get the error you're seeing. You may have to use ActiveX to control IE and download the files programmatically.
    Chris C
    Chris Cilino
    National Instruments
    LabVIEW Product Marketing Manager
    Certified LabVIEW Architect

  • I am concerned about personal data being not encryption in transit over the Internet and therefore can be seen by other people.

    I am a new Firefox user. I have just installed Firefox 4 on my windows PC today, 5/27/11. I have two major questions:
    1. Accidentally, I clicked some thing at random on the screen (I can't remember what it was) and this page, http://us.config.toolbar.yahoo.com/bh/v2/wp/?view=wc&intl=us&pc=yma3&dc=v2_upgd&cv=2.3., showed up under Yahoo! Toolbar. It informed me that the connection was not encrypted and that information sent over the Internet could be seen by other people. I am not sure what the warning is all about. Does it mean when I use Firefox as a browser to access the Yahoo! and other Internet sites, e.g., my bank, all my personal (username, password, etc.) and bank data will be seen by other unauthorized people? I have never seen a similar warning from other browsers, such as Internet Explorer and Safari? So, if Firefox does not offer protection of personal data, I wonder what's the point of using it. I could have misinterpreted the Firefox warning and would highly appreciated it if you can clarify.
    2. During the installation process, a message showed that Firefox 4 was not compatible with certain features of some of the software already on my PC. I did not copy those features and do not remember what they were except one that was associated with my firewall ZoneAlarm. I could be wrong but I think the message also said Firefox had removed the incompatible features. Please tell me if I should be concerned about it, especially the one that was removed from ZoneAlarm. Will my PC become susceptible to hacker invasions when I use Firefox as the browser? I wish Firefox had given some written explanations along with the incompatibility and removal message so that a user can understand exactly what it is about.
    I would appreciate to hearing from you at your earliest convenience. I have tentatively suspended using Firefox until I can be assured that it is safe to do so without potentially compromising my personal data.
    Thank you.

    That is a generic warning message that you get if you submit a form via a normal HTTP connection (i.e not in via a secure HTTPS connection). That warning pop-up probably has a box to suppress this message in the future.
    If you exchange data with your bank site then there should be a secure connection.
    You can verify that by clicking the Site Identity Button (website's favicon) on the left end of the location bar.
    * https://support.mozilla.com/kb/Site+Identity+Button
    You need to check the ZoneAlarm website to see if they have an update of their software that is compatible with Firefox 4.0.1

Maybe you are looking for