SQL Server+JSP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • doniravi
    New Member
    • Jan 2007
    • 12

    #1

    SQL Server+JSP

    Hi all:

    I am trying to connect to SQL Server 2000 database using SQL Server 2005 JDBC driver. I have set the classpath for the driver as C:\Program Files\SQL Server 2005 JDBC Driver\sqljdbc_ 1.0\enu\sqljdbc .jar and I copied sqljdbc.jar file in the lib directory of WEB-INF.i set msutil.jar,mssq lserver.jar and msbase.jar files into classpath and lib folder of WEB-INF. I have a login.jsp page that asks for user name and password to log on... when you click submit... it doesn't go anywhere... and I checked the tomcat server console... doesn't give me any error. The url and driver I used inside login.jsp page looks like this...

    url = "jdbc:microsoft :sqlserver://localhost:1433; Database name=ravi";

    driver = "com.microsoft. sqlserver.jdbc. SQLServerDriver "


    Class.forName(d river);
    conn = DriverManager.g etConnection(ur l, "sa","sa");

    How do I make Tomcat to talk to the SQL Server 2000 database using SQL Server 2005 JDBC driver? Please help and it is highly appreciated.

    what i need to do to run my sql database which is in sql server to access with jsp.

    plz dont tell me like that my url is not correct. the url which i mentioned is correct to my knowledge.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by doniravi
    Hi all:



    I am trying to connect to SQL Server 2000 database using SQL Server 2005 JDBC driver. I have set the classpath for the driver as C:\\Program Files\\SQL Server 2005 JDBC Driver\\sqljdbc _1.0\\enu\\sqlj dbc.jar and I copied sqljdbc.jar file in the lib directory of WEB-INF.i set msutil.jar,mssq lserver.jar and msbase.jar files into classpath and lib folder of WEB-INF. I have a login.jsp page that asks for user name and password to log on... when you click submit... it doesn\'t go anywhere... and I checked the tomcat server console... doesn\'t give me any error. The url and driver I used inside login.jsp page looks like this...



    url = \"jdbc:microsof t:sqlserver://localhost:1433; Database name=ravi\";



    driver = \"com.microsoft .sqlserver.jdbc .SQLServerDrive r\"





    Class.forName(d river);

    conn = DriverManager.g etConnection(ur l, \"sa\",\"sa\ ");



    How do I make Tomcat to talk to the SQL Server 2000 database using SQL Server 2005 JDBC driver? Please help and it is highly appreciated.



    what i need to do to run my sql database which is in sql server to access with jsp.



    plz dont tell me like that my url is not correct. the url which i mentioned is correct to my knowledge.


    Post this question in the Java forum and provide the code (using code tags) for your JSP.

    Comment

    • Ganon11
      Recognized Expert Specialist
      • Oct 2006
      • 3651

      #3
      This thread has been moved to the Java forum.

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by Ganon11
        This thread has been moved to the Java forum.
        Now we need to see the code for the JSP first so we don't make any wrong assumptions in suggesting a solution.

        Comment

        Working...