Questions tagged [connection]

Refers to a connection used to transfer data between two endpoints, such as between a client and a web, database, web service or other server.

A connection is a session established between two communications endpoint applications.

10252 questions
36
votes
4 answers

Help troubleshooting SqlException: Timeout expired on connection, in a non-load situation

I have a server hosting a website of mine that has almost zero-traffic. A few people (< 20) enter the site every day, and a few RSS readers are subscribed to some feeds we put out. Almost every night, an RSS reader will hit us in the middle of the…
Daniel Magliola
  • 30,898
  • 61
  • 164
  • 243
36
votes
2 answers

When to close Connection, Statement, PreparedStatement and ResultSet in JDBC

Few questions on JDBC coding: For a single client application, do we need a Connection pool? Is it a good idea to create a Connection at the beginning and keep it alive without close it until application exit? Why? PreparedStatement is associated…
5YrsLaterDBA
  • 33,370
  • 43
  • 136
  • 210
35
votes
8 answers

Eclipse : Failed to connect to remote VM. Connection refused.

When ever i tried to launch my eclipse debug(for server side code) i'm getting the following error Failed to connect to remote VM. Connection refused. What's the problem may be? I already tried with most of the solutions out in the web but none of…
Miko
  • 2,615
  • 9
  • 33
  • 58
35
votes
2 answers

Why does an Entity Framework Connection require a metadata property?

I switched my DAL from using LINQ over to Entity Framework. Because my application connects to different databases depending on the current user, I need to dynamically create the DataContext at run time and pass in the appropriate connection…
John B
  • 20,062
  • 35
  • 120
  • 170
34
votes
5 answers

SoapUI: ConnectException: Connection timed out:

i try to send request via REST. I get success response when using firefox rest-client, but in SoapUI i get exception attached below. How to resolve this issue? Thanks. java.net.ConnectException: Connection timed out: connect at …
katrin
  • 1,146
  • 1
  • 13
  • 24
33
votes
10 answers

Need Code to create Connection Pool in java

Need code to create the connection pool in java? How does we make sure that connection pool doesn't return the same object which is already in use? How happens if client closed the connection after taking it out from Connection pool? Update 1: I…
mohan
  • 487
  • 1
  • 5
  • 5
32
votes
14 answers

Could not recognize my android device on mac

I am trying to connect my android device on mac to test application I developed. First I installed USB driver, then I activated in my phone the developer option by tapping on Build Number and then tick USB debugging option. Once I did all those…
Salif
  • 992
  • 1
  • 8
  • 14
31
votes
4 answers

Run batch file with psql command without password

I am trying to execute this psql command using a batch script: psql --host=localhost --dbname= --port= --username= --file=C:\PSQL_Script.txt --output=C:\PSQL_Output.txt The problem is that it's asking for the…
shabu 224
  • 331
  • 1
  • 3
  • 4
31
votes
4 answers

Closing WCF connection

We are using WCF service on the client side we are planning to explicitly close the connection It seems there are more then one way of closing Sample1: In the finally block of the WCF service consumption use if (client.State ==…
Balaji
  • 2,109
  • 5
  • 27
  • 34
29
votes
8 answers

How to check the Internet connection with .NET, C#, and WPF

I am using .NET, C# and WPF, and I need to check whether the connection is opened to a certain URL, and I can't get any code to work that I have found on the Internet. I tried: Socket socket = new Socket(AddressFamily.InterNetwork,…
Ragnar
  • 4,292
  • 4
  • 31
  • 41
29
votes
4 answers

Samsung Galaxy Phone is not recognized on Android Studio

My Samsung phone was not recognized by Android Studio on windows 7. I repaired it by installing the Samung Driver here: http://developer.samsung.com/technical-doc/view.do?v=T000000117 I tested with my Galaxy S2 and the Samsung S7560 and it works…
jony
  • 277
  • 1
  • 3
  • 7
29
votes
2 answers

Which should I close first, the PreparedStatement or the Connection?

When using a PreparedStatement in JDBC, should I close the PreparedStatement first or the Connection first? I just saw a code sample in which the Connection is closed first, but it seems to me more logical to close the PreparedStatement first. Is…
froadie
  • 79,995
  • 75
  • 166
  • 235
29
votes
5 answers

android - how to prevent webview to load when no internet connection

I have an Android app which has a webview. When there's no internet connection, webview will display page not available. I want to make this look like an app as much as possible, so I don't want to display this page. I found some useful info online…
user1865027
  • 3,505
  • 6
  • 33
  • 71
28
votes
9 answers

Java detect lost connection

When I'm using e.g. PuTTY and my connection gets lost (or when I do a manual ipconfig /release on Windows), it responds directly and notifies my connection was lost. I want to create a Java program which monitors my Internet connection (to some…
kresjer
  • 767
  • 3
  • 10
  • 17
28
votes
5 answers

How to check if connection was aborted in node.js server

I'm making some long polling with node.js. Basically, node.js server accepts request from the user and then checks for some updates. If there're no updates, it will check them after the timeout. But what if user has closed his tab, or went to…
AbstractVoid
  • 3,583
  • 2
  • 39
  • 39