Reputation: 51
I've deployed my java application on GAP. in jsp i connect to external database hosted on somee.com. I successfully loaded the sqljdbc4.jar but when i connect to database i got the following error
java.lang.RuntimeException: Resolve failed: Request=LibraryProject.mssql.somee.com Exception=java.net.SocketException: Socket operation timed out: The API call remote_socket.Resolve() took too long to respond and was cancelled.
I put the driver inside the lib folder and use the following code to connect to database
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String conURL="jdbc:sqlserver://LibraryProject.mssql.somee.com";
Connection con=DriverManager.getConnection(conURL,"mrquack","complete1");
the code looks fine and works well on localhost and gives the above error on appengine please tell me a solution
Upvotes: 1
Views: 559
Reputation: 3115
Google App Engine Sandbox does not allow to open a socket or access another host directly. sqljdbc4.jar is using java.net.Socket
which is not allowed.
Upvotes: 1