One way of connecting to a database is through the JDBC driver manager using the method DriverManager.getConnection. This method uses a string containing a URL. The following is an example of using the JDBC driver manager to connect to Microsoft SQL Server 2000 while passing the user name and password:
hostname is the TCP/IP address or TCP/IP host name of the server to which you are connecting.
NOTE: Untrusted applets cannot open a socket to a machine other than the originating host.
port is the number of the TCP/IP port.
property=value specifies connection properties. See "Connection String Properties" for a list of connection properties and their values.
driver name
"com.microsoft.jdbc.sqlserver.SQLServerDriver"
URL
"jdbc:microsoft:sqlserver://server1:1433,DatabaseName=xxx"