I am using Orion J2EE Server (from http://www.orionserver.com) and I want to
create a data-source that will connect to a SQL Server 7.0 database.

I got a free open source JDBC 2.0 driver from http://www.freetds.org/ and I
am open to other SQL Server drives that are free or have no expiration data.
If I can use 1 or 2 connections then that would be fine.

Anyway, my Data Source looks something like this:

<data-source
  class="com.evermind.sql.DriverManagerDataSource"
  name="TestSQL"
  location="jdbc/TestCoreDS"
  xa-location="jdbc/xa/TestXADS"
  ejb-location="jdbc/TestDS"
  connection-driver="com.internetcds.jdbc.tds.Driver"
  username="sa"
  password=""
  url="jdbc:freetds:sqlserver://my_server:1433/my_database"
  inactivity-timeout="30"
 />

And here is the code I am using to see if this works:
import javax.sql.DataSource;
import javax.naming.InitialContext;

class TestSQL
{

 public static void main (String args[])
 {
  try
  {
   // Obtain connection
   InitialContext ctx = new InitialContext();
   DataSource ds = (DataSource) ctx.lookup("jdbc/TestDS");
   Connection conn = ds.getConnection();

   // Create query and get results
   Statement stmt = conn.createStatement();
   ResultSet rs = stmt.executeQuery("SELECT name FROM staff");

   // List results
   while ( rs.next() )
   {    System.out.println( rs.getString("name") + "<br>");     }

   // Close connection - important!
   conn.close();
  }
            catch(Exception e)
            {    System.out.println("Error: " + e.getMessage() );    }
 }

}

The error I am getting is as follows:
Error: Need to specify class name in environment or system property, or as
an applet parameter, or in an application resource file:
java.naming.factory.initial

I don't get this at all, so if anyone can be of any help, that would be
great!   In the meantime, I will keep plugging away.

Thanks.

                            Tom

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to