Hi there,
 
We are trying connecting to SQL server from a linux system using weblogic sql server driver on orion 1.2.9 with sun jdk 1.2.But we get the error unable to open a socket to sqlservername:1433.Any thoughts on how i could solve this problem would be greatly appreciated.
The code that i use is
 
import java.sql.*;
import java.util.*;
import java.io.*;
 
public class BnDBConnect implements Serializable {
 
 file://Bean Properties
 
 String DB_User = "RAE", DB_Password = "rae28", DB_Name = "RAE", DB_Server = "dbs", driver = "jdbc:weblogic:mssqlserver4";
 ResultSet rs;
 ResultSetMetaData rsmd;
 int NumColumns=0, i=0;
 Connection connection = null; 
   Driver mydriver;
  
   public Connection getConnection() {
      try {
       file://Create an instance of the driver
     mydriver=(Driver)Class.forName ("weblogic.jdbc.mssqlserver4.Driver") .newInstance();
    
     file://Specify the properties for connection
       Properties props = new Properties();
         props.put("user",DB_User);
         props.put("password", DB_Password);
         props.put("db", DB_Name);
         props.put("server", DB_Server);
        
         file://Connect to the database                 
         connection = mydriver.connect(driver, props);
      }catch (Exception e) {
       System.out.println("Error connecting to database"+e);
    }
    return connection;
   }
  
   public void closeConnection() {
    try {
     connection.close();
  }catch (Exception e) {
   }
 }
}
 
 
 
Regards,
 
Karthik
----------------------
how far can the e in your business go?
----------------------------------------------------------------
s c a p e V e l o c i t y net solutions
15, jeevaratnam nagar, adyar, chennai - 600020
Phone: 4916623 Fax: 4903771
ICQ:54910615
www.scapeVelocity.com

Reply via email to