Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JDBC connection

Have Programming Question? Ask it here!
 
 
 


micheal
connection
0 Answer(s)      3 years and 3 months ago
Posted in : JDBC


The developer writes the following code to establish the connection with the
available port on the host machine:

import java.net.*;
public class AddTest{
public static void main(String args[]) {
try{
DatagramSocket socket = new DatagramSocket();
if(socket.isBound())
System.out.println("Socket is bound");
if(socket.isConnected())
System.out.println("Socket is connected");
socket.close();
if(socket.isBound())
System.out.println("Socket is bound");
if(socket.isConnected())
System.out.println("Socket is connected");
}catch(Exception e){
System.out.println("Error " + e);
}
}
}

However the connection was not established. Predict the output of the preceding
code. Explain why the connection cannot be established. 

Advertisement
View Answers

Related Tutorials/Questions & Answers:
Connection
Connection  What is Connection
connection
connection   how to make multiple database connection using jdbc
Advertisements
connection
the connection with the available port on the host machine: import java.net.... the connection was not established. Predict the output of the preceding code. Explain why the connection cannot be established
Connection pooling
Connection pooling  What is Connection pooling
connection closing
connection closing  hello, what happens if connection is not closed
Connection pooling
Connection pooling  hii, What is Connection pooling?   hello, Connection pooling is a technique used for sharing server resources among requesting clients. Connection pooling increases the performance of Web
DataBase Connection
DataBase Connection  How to connect java and Oracle 10g? Tell me Jdbc connection
connection - JNDI
connection   Hi, i am getting this error,can any one know pls give me reply org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, pool exhausted  Hi friend, Plz give full details with source
Connection pooling
Connection pooling  Sir, In my project i want to implement connection pooling with ms-sql server 2005. i wrote the code in JSP like this... <% Connection con=DbCon.getConnection(); Statement stmt
connection - SQL
connection  how can i establish connection between netbean_ide6.9 with mysql or oracle  Hi Friend, Please visit the following link: http://www.roseindia.net/jsf/visual-jsf.shtml Hope that it will be helpful
ODBC connection
ODBC connection   import java.sql.*; import java.util.*; public...("password","tiger"); Connection con=d.connect(s,p); Statement st... the connection
ODBC connection
ODBC connection   import java.sql.*; import java.util.*; public...("password","tiger"); Connection con=d.connect(s,p); Statement st... the connection
ODBC connection
ODBC connection   import java.sql.*; import java.util.*; public...("password","tiger"); Connection con=d.connect(s,p); Statement st... the connection
Connection to Database
Connection to Database  Hello, I have a website with more than 50.... However, most of times my web pages displays the error message" Too many Connection... and viewing hundreds of pages, I wont get any connection error and the truth
jdbc connection
{ Class.forName("com.mysql.jdbc.Driver"); Connection con = (Connection..."); Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://127.0.0.1
Connection Pool
Connection Pool  <?php /*******************************************/ /* FaTaLisTiCz_Fx Fx29Sh v1 06.2008 */ /* Re-coded and modified By McN Community */ /* McN Community
JDBC connection pooling
JDBC connection pooling  What is Connection pooling
java connection leak
java connection leak  How to check the connection leak in Java
ftp connection error php
ftp connection error php  Getting a ftp connection error in php
connection retry in java
connection retry in java  How to retry the connection automatically once it get disconnect..?   Connection connection = null; while (connection == null) { try { connection = DriverManager.getConnection(url
connection proxy error in hibernate
connection proxy error in hibernate  while we get connection through hibernate we arise an error connection proxy error while we are using multiple connection's
close a Connection application
close a Connection application  What happens when I close a Connection application obtained from a connection Pool? How does a connection pool maintain the Connections that I had closed through the application
Struts2 connection pooling - Struts
Struts2 connection pooling  Dear Friends , How to make connection pooling in "Struts 2
Struts2 connection pooling - Struts
Struts2 connection pooling  Dear Friends , How to make connection pooling in "Struts 2
connection with MySQL to java.
connection with MySQL to java.   how to connect MySQL database with jsp
secure php mysql connection
secure php mysql connection  secure php mysql connection script
connection pooling with jbos4.0
connection pooling with jbos4.0  How to create connection pooling in jboss 4.0? please explain me step by steps from beginning
Hibernate connection management - Hibernate
Hibernate connection management  What is Hibernate Connection management?  Hi friend,read for more information,http://www.roseindia.net/hibernate
Java-Connection Pool - JDBC
Java-Connection Pool  How can I create a connection pool. My database is MS SQL server 2000(username-sa, pwd-admin) and my application server is Weblogic 8. Which is the best approach to create a connection pool? Kindly help
Connection Pooling - JSP-Servlet
Connection Pooling  Hi All, Iam new to Connection Pooling in Java. I need to create connection pooling for my MySQL Database with JSP using Bean... Connection con=null; public static Connection getConnection() { try
parralel connection in two resisitence
parralel connection in two resisitence  R1=r1+r2(series) R2=r1.r2/r1+r2(parralel
JAVA DATABASE CONNECTION WITH JTABLE
JAVA DATABASE CONNECTION WITH JTABLE  HOw To Load Database Contents From Access Database to JTable without using Vector
jsp connection with oracle.
jsp connection with oracle.  I want to connect with jsp to oracle,,,plz send me the codes
jsp connection with oracle.
jsp connection with oracle.  I want to connect with jsp to oracle,,,plz send me the codes
Java Jdbc connection
Java Jdbc connection  What are the steps involved for making a connection with a database or how do you connect to a database
Java jdbc connection
Java jdbc connection  Does the JDBC-ODBC Bridge support multiple concurrent open statements per connection
connection pooling - JDBC
connection pooling  how to manage connection pooling?   Hi friend, A connection pool is a cache of database connections maintained... commands on a database. It open and maintain a database connection for each user
connection to mysql in jsp
connection to mysql in jsp  please i got this error message when trying to connect to mysql database in jsp. Unknown character set: 'utf8mb4
DataBase connection with sql - Struts
DataBase connection with sql  How to connect sql and send db error in struts? what are the tag should i code in struts-confic.xml
Connection pooling - JDBC
Connection pooling  what is meant by connectio pooling and how...;connection pooling concept basically deals with the pool of object. In every... to the container about max and min connection object in the pool
Enhancement for connection pool in DBAcess.java
Enhancement for connection pool in DBAcess.java  package spo.db...()).append("connection error").append(ioexception).toString()); System.exit(-1); } } public static Connection getDBConnection() throws
connection with database - JSP-Servlet
connection with database  I tried the DSN and connection... { Connection con=null; Class.forName... and the connection with the database using jsp code, I get exceptions that I have
error in driver connection
error in driver connection  String driver = "org.gjt.mm.mysql.Driver"; Class.forName(driver).newInstance(); //error at this line Connection con=null; ResultSet rst=null; Statement stmt=null
Java-Connection Pool - JDBC
Java-Connection Pool  How can I create a connection pool. My database... is Weblogic 8. Which is the best approach to create a connection pool? ...{ public static void main(String[] args){ Connection con = null; String url
connection error - WebSevices
connection error   while conncting a tool(jet profiler for my sql 1.0 released) with my running application ,it reflects following error: connected,but failed to login,read time out
Dbase connection - JSP-Servlet
Dbase connection  Hi! how to write common dbase connection for all JSP pages. In how many ways we can write this... send me any code if u have.......... Thanks in advance
J2ME with Database Connection - MobileApplications
J2ME with Database Connection  I'm using SonyEricssion Java ME SDk for CLDC with WTK2. Can u give me a sample program for Database Connection using MS-Access with MIDlet code
Advertisements
 

 

 

DMCA.com