java - connection string for android to sqlserver -


i've started developing android application connects sqlserver db, i've connected db connection string :

connurl = "jdbc:jtds:sqlserver://" + _ip+ ":" + _port + ";" + "databasename=" + _db + ";usentlmv2=true;integratedsecurity=true"; 

but works if try on device connected same network in server connected because ip put in connection string 192.168.1.7. should make work if try in network ? i've tried replacing ip address ip address got what ip wont connect.

that's because you're behind nat , address isn't reachable outside world. need move server real ip address, or poke hole in nat , allow address rerouting.

but that's ok, because should never directly connect db anyway- not have allow db server reached public internet, have put login info in public app. totally insecure. should have webservice between , db. webservice should 1 password, , should data db , return in json or xml format.


Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -