I downloaded the Microsoft SQL Server jdbc driver, version 1.2 here:
http://msdn2.microsoft.com/en-us/data/aa937724.aspx
 
I read the instructions about using this driver,
http://msdn2.microsoft.com/en-us/library/ms378526.aspx and the .dll for
integrated security,
http://msdn2.microsoft.com/en-us/library/ms378428.aspx , "Connecting
with Integrated Authentication" - towards bottom of page.

Basically it says copy the .dll to where ever you put the sqljdbc.jar
file.  I put my sqljdbc.jar file here:  C:\Tomcat5028\common\lib
 
I'm just pasting some java code into a jsp page, just to see if I have
the connection working.  I just want to print out some records to a
page.
 
Here is the code I'm using:

I've tried using the :port number after myservername, and it makes no
difference.
 
try {
        Class.forName( "com.microsoft.sqlserver.jdbc.SQLServerDriver");
        String connectionUrl = "jdbc:sqlserver://myservername;" +
 
"instanceName=myinstancename;databaseName=mydatabasename;integratedSecur
ity=true;";

        Connection con = DriverManager.getConnection(connectionUrl);

        Statement stmt =
con.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ON
LY);

        String query = "Select Request_Id From dbo._mySQLView";
      
        ResultSet rs = stmt.executeQuery(query);
                while(rs.next()){
                                out.print(rs.getString(1));
                        }
                        rs.close();
                  stmt.close();
                  con.close();

}catch(SQLException ex) {
        out.print("This is where it fails, under SQLException: " +
ex.getMessage()); } catch(java.lang.ClassNotFoundException jdbce) {
      out.print("ClassNotFoundException: ");
      out.println(jdbce.getMessage());
}

The information that is written to the page is:
This is where it fails, under SQLException: This driver is not
configured for integrated authentication. 

How do I configure the driver for integrated authentication?  Do I need
to do this in Tomcat or somewhere else?

Leo D
 
Leo D

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to