0
голосов
2ответов
3698 просмотров

Java: Socket close connection and ObjectInputStream

My code looks like this, this is Server code (Runnable) public void run() { while (true) { try { System.out.println("Waiting for client..."); this.socket = serverSocket.accept(); System.out.println("Client accepted"); while (true) { ...

10
голосов
5ответов
6251 просмотров

How do I make my Java application identify itself to Oracle on connection?

When my application connects to an Oracle database I want to be able to see by looking at the active sessions in the database that it is connected. Currently it identifies itself as "JDBC Thin Client" because that's the driver that I'm using, but other Java based applications that I have are some...

2
голосов
3ответов
2396 просмотров

Apache -> MySQL multiple connections vs one connection

I've been thinking, why does Apache start a new connection to the MySQL server for each page request? Why doesn't it just keep ONE connection open at all times and send all sql queries through that one connection (obviously with client id attached to each req)? It cuts down on the handshake tim...

2
голосов
3ответов
632 просмотров

J2me Httpconnection,which one is better get or post?

In J2ME ,Which connection type is better?Get or post.Which one is faster?which one uses less bandwidth?and which one is supported by most of the handsets?What are the advantages and disadvantages of both?

3
голосов
2ответов
877 просмотров

PHP: Is there a way to change request address?

For some reason, if I request a file using a url such as this: http://localhost/proxy.php?url=http://anintranetsite/file.jpg It works! I can get the file. But if I use, http://127.0.0.1/proxy.php?url=http://anintranetsite/file.jpg I cannot get it to work. I am not unnderstanding what ...

1
голосов
2ответов
2939 просмотров

Oracle Home for Visual Studio

Okay. Forgive me, but I'm going to vent a little here. Visual Studio doesn't recognize my TNSnames for oracle so I can't connect to my database. I believe the problem is that I have multiple homes on my machine, one for me (In C:/app/{UserName}/product/11.1.0) and one general one which was alread...

3
голосов
2ответов
1440 просмотров

Getting Connection timeout in OCCI

I need to test the connectivity if the Oracle::OCCI::Connection, and how can i get and set the connection timeout value? i read the documentation of Oracle OCCI but i can't find the required functions. Thanks in Advance.

4
голосов
4ответов
4629 просмотров

Problem with Java Sockets (in tic tac toe game)

I have built a two-player tic tac toe game in Java, using sockets (no threads). I have it working, except for terminating the clients when the game is over. Basically, I have it set up so that once a game is over (the server recognizes a win or a draw), then the server will send a message to the ...

-2
голосов
2ответов
702 просмотров

Will php autoreconnect to MySQL?

$con = mysql_connect("localhost:".$LOCAL_DB_PORT, $LOCAL_DB_USER, $LOCAL_DB_PASS); mysql_select_db("hr", $con); mysql_query("set names utf8", $con); while(true) { do_stuff($con); sleep(50); } If connection timesout in 50 seconds,will $con still work?

0
голосов
1ответов
3501 просмотров

tcp connection in TIME_WAIT won't allow reconnect, java

After making a tcp connection to a server, I close my linux application and Socket.close() is called. Checking netstat -pant, I see the connection is in TIME_WAIT status. This prevents me from making an immediate connection back to the server since I'm using the same port to connect from. Inst...

22
голосов
3ответов
25537 просмотров

What exactly does a "persistent connection" mean?

I read about "HTTP persistent connection" but somehow I don't seem to understand what does persistent mean in this context. Could you'll elaborate?

12
голосов
2ответов
6566 просмотров

Reconnect RMI client after server restart

I have an RMI server and a desktop RMI client. When I restart the server, I get errors in the client. Is it possible to restart the RMI connection without restarting the client? [EDIT] Here is the stacktrace: java.rmi.ConnectException: Connection refused to host: xxx.xxx.xxx.xxx; nested excepti...

1
голосов
2ответов
905 просмотров

Unable to close JDBC resources!

We are running a websphere commerce site with an oracle DB and facing an issue where we are running out of db connections. We are using a JDBCHelper singleton for getting the prepared statements and cosing the connections. public static JDBCHelper getJDBCHelper() { if (theObject...

8
голосов
3ответов
4076 просмотров

How many concurrent outbound HttpWebRequest calls can be made in ASP.NET / IIS7?

I'm writing an ASP.NET web application which will run on Windows Server 2008 (IIS7). Each page's codebehind will need to make at least one synchronous web service call to an external server using HttpWebRequest and GET. My question - is there any limit to the number of outbound HttpWebRequest c...

2
голосов
3ответов
1144 просмотров

VSTO 3.0 Get/Change an excel 2007 workbook connection

I've struggling to find a way to get and change and excel 2007 workbook connection (Menu Data -> Existing Connections -> Connections on this Workbook).It's a connection (several actually) to a SQL Server and used in a pivot table. I've tried using Application.ActiveWorkbook.Connections or ...

2
голосов
4ответов
9791 просмотров

Connection issue in JayBird

I am new to Firebird using its Java version Jaybird, But unable to connect from database (.fdb file). The problem comes like this: org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544375. unavailable database OR java.lang.RuntimeException: Failed to initilize Jaybird native library. This...

3
голосов
3ответов
3216 просмотров

A new sql connection for each query?

I'm writing a server application that's communication with a local sql server. Each client will need to read or write data to the database. Would it be better to have a thread safe class which will enqueue and executes the sql commands on a single sql connection? Or should I open a new connecti...

2
голосов
1ответов
739 просмотров

Make ADO.NET (and EntityFramework) release a database

I'm creating and dropping databases on the fly for some integration tests. I'm doing all the database management at the ADO.NET level. For the tests I'm using Entity Framework because the entities is one part of what I am testing. The problem is that after I do this: using (ProjectEntities db = ...

2
голосов
3ответов
1892 просмотров

Storing database connections in session, in a small scale webapp

I have a j2ee webapp that's being used internally by ~20-30 people. There is no chance of significant growth in the number of users. From what I understood there's a trade-off between opening a new DB connection for each request made to the webapp (expensive, but doesn't block other users when ...

3
голосов
5ответов
7942 просмотров

Connection pooling with Java and MySQL in Tomcat web application

I recently wrote and deployed a Java web application to a server and I'm finding an unusual problem which didn't appear during development or testing. When a user logs in after so long and goes to display data from the database, the page indicates that there are no records to see. But upon page ...

1
голосов
5ответов
1206 просмотров

Can't establish SQL Server connection from VS 2008

I am sorry if this sounds like a silly question, but I have googled for a while for a solution and no success. I am trying to establish a connection from VS 2008 to SQL Server. I am trying to use an user that my web application has been successfuly using to access the database from in its connect...

23
голосов
3ответов
76983 просмотров

iPhone TCP/IP Socket Server/Client Program

I have read a lot of questions regarding this subject on this website however they didn't quiet answer my question. If you can't be ### about my goal or background skip to the question. My Goal Is to build a server that can run on Mac OS X 10.4+ and later, port it to Windows XP/Vista (no idea ...

0
голосов
7ответов
452 просмотров

Can a protocol be secured by encryption?

This is something I've always wanted to learn. When I design a system (software or hardware) where multiple components communicate with each other, how can I implement some simple encryption or other features in the protocol for some basic security? I can change the protocol anyhow, since I have...

4
голосов
3ответов
6130 просмотров

Can a PHP script detect if a socket has been closed?

How can a PHP script detect if a socket has been closed by the remote party?

0
голосов
2ответов
799 просмотров

Trying to connect to MDF Database without using a trusted connection

Is there anyway to connect to an MDF file without using a trusted logon? I've gone into management studio and created an account called bob with password bob, given that account full access and also added the account to the database. When i try to connect using that account I get the following e...

0
голосов
3ответов
604 просмотров

Using Memcache for storing connection objects

Is it advisable to store SQL Connection objects in memcache?

1
голосов
4ответов
607 просмотров

When i execute get LDAPConnection through Swing it hangs

When I run following code through Main method, it works fine but when i try to execute it on click of swing button, it hangs. Please help import java.util.Hashtable; import javax.naming.AuthenticationException; import javax.naming.Context; import javax.naming.NamingException; import javax.nami...

31
голосов
4ответов
30785 просмотров

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 night and get an exception that the website ca...

0
голосов
1ответов
800 просмотров

Closing a TCPlistener/client connection

Is it necessary to close the connection of a tcplistener or tcpclient after every message received, or is it possible to close it at a later time while it continues to receive data? Is there any major security issue with leaving it open and listening? I know trojans tend to open a listener and le...

86
голосов
12ответов
157741 просмотров

How to create a bash script to check the SSH connection?

I am in the process of creating a bash script that would log into the remote machines and create private and public keys. My problem is that the remote machines are not very reliable, and they are not always up. I need a bash script that would check if the SSH connection is up. Before actually c...