Invalid URL on JDBC connection to SQL Server 2000

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

    #1

    Invalid URL on JDBC connection to SQL Server 2000

    hello sir...

    i m using sql server 2000 database and usig jsp to access it
    when accessig i am getting followig error

    java.sql.SQLExc eption: [Microsoft][SQLServer 2000 Driver for JDBC]Unable to connect. Invalid URL.

    i installed Microsoft SQL Server 2000 Driver for JDBC in my system.
    do i need to do ay thing extra other tha thse thing?

    this is my code:

    <%@ page import = "java.io.*" import = "java.lang. *"
    import = "java.sql.* " %>
    <%
    out.println("<h 2>Successfully logged in11111111</h2>");
    try
    {
    Class.forName(" com.microsoft.j dbc.SQLServerDr iver");
    Connection con=DriverManag er.getConnectio n( "jdbc:host://localhost:8080/ravi","sa","sa" );
    Statement st = con.createState ment();
    String sql="INSERT INTO ravi1 VALUES ('Michael', 'dba', '90000' )";
    st.executeUpdat e(sql);
    }


    waiting for u r rply


    thanks in advace
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    This question is being moved to the Javascipt Forum.

    ADMIN

    Comment

    Working...