KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > java > net > UnknownHostException

java.net
Class UnknownHostException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.io.IOException
              extended by java.net.UnknownHostException
All Implemented Interfaces:
Serializable
See Also:
Top Examples, Source Code

public UnknownHostException()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[1176]JDBC ConnectionManager
By Anonymous on 2004/12/06 19:30:15  Rate
 
 import java.sql.Connection; 
 import java.sql.DriverManager; 
 import java.sql.SQLException; 
  
  
 public class ConnectionManager  {  
     private static ConnectionManager instance; 
     private Connection connection = null; 
      
     private ConnectionManager (  )  throws SQLException  {  
         // load driver 
         try  {  
             Class.forName ( "com.mysql.jdbc.Driver" ) ; 
          }  catch  ( ClassNotFoundException e )   {  
             throw new RuntimeException ( e ) ; 
          }  
          
         // create connection 
         connection = DriverManager.getConnection ( "jdbc:mysql://@locallhost/svh" ) ; 
      }  
      
     public synchronized static ConnectionManager getInstance (  )  throws SQLException  {  
         if  ( instance == null )   {  
             instance = new ConnectionManager (  ) ; 
          }  
         return instance; 
      }  
      
     public Connection getConnection (  )   {  
         return connection; 
      }  
  }  
 


public UnknownHostException(String host)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  

Popular Tags