Hi,

I am having a problem with connecting the sample applications (e.g. ATM and
Addressbook)  to SQL Server . When I deploy the sample applications (e.g.
atm-ejb.jar) I get the following error message: "SQL error: Connection is
broken: Connection refused: no further information".

I did the following things:
- I installed the sample applications and deployed them. 
- They work fine with the HypersonicSQL Database.
- I downloaded the trial version of i-net Una 2000 Driver Version 3.04 for
MS SQL Server;
- I put the Una200.jar file in the \ORION\LIB directory;
- I tested the driver with a Java programm found in the README.TXT of the
i-net driver (see below) => works fine!
- I changed the properties of the Hypersonic datasource in DATA-SOURCES.XML
(see below);
- I removed the \ORION\APPLICATION-DEPLOYMENT directory (to make sure that
the sample applications are redeployed); 
- I started Orion

Does anybody had the same problems and found a solution? Or does anybody
know if I did something wrong?

Thanks!


Marco.

FYI: I am using Windows 2000 Professional, JDK1.2.2 and SQL-Server 7.0.


Data Source
------------------

<data-source
        class="com.evermind.sql.DriverManagerDataSource"
        name="Hypersonic"
            schema="database-schemas/ms-sql.xml"
        location="jdbc/SQLServerCoreDS"
        xa-location="jdbc/xa/SQLServerXADS"
        ejb-location="jdbc/SQLServerDS"
        connection-driver="com.inet.tds.TdsDriver"
            max-connections="2"
        username="sa"
        password=""
        url="jdbc:inetdae://JANSEN001"
        inactivity-timeout="30"
/>

Java Test Program
---------------------------
import java.sql.*;                  // JDBC package

public class dbtest {

  public static void main(String[] args) {

    String url = "jdbc:inetdae://JANSEN001";// use your hostname and port
number here
    String login = "sa";                                // use your login
here
    String password = "";                               // use your password
here

        try {
                DriverManager.setLogStream(System.out);         // to create
more info 
                                                                // for
technical support
                        
                //load the class with the driver
                //Class.forName("com.inet.tds.TdsDriver");              //
JDK,Netscape
                //or
                Class.forName("com.inet.tds.TdsDriver").newInstance();  //
JDK,Netscape,IE
                //or
                //new com.inet.tds.TdsDriver();                         //
JDK,Netscape,IE

                
                //set a timeout for login and query
                DriverManager.setLoginTimeout(10);


                //open a connection to the database
                Connection connection =
DriverManager.getConnection(url,login,password);

                //to get the driver version
                DatabaseMetaData conMD = connection.getMetaData();
                System.out.println("Driver Name:\t"    +
conMD.getDriverName());
                System.out.println("Driver Version:\t" +
conMD.getDriverVersion());

                //select a database
                connection.setCatalog( "master");

                //create a statement
                Statement st = connection.createStatement();

                //execute a query
                ResultSet rs = st.executeQuery("SELECT * FROM coffees");

                // read the data and put it to the console
                while (rs.next()){
                        for(int j=1; j<=rs.getMetaData().getColumnCount();
j++){
                                System.out.print( rs.getObject(j)+"\t");
                        }
                        System.out.println();    
                }

                
                //close the objects
                st.close();
                connection.close();

        } catch(Exception e) {
            e.printStackTrace();
        }
  }
}

Reply via email to