Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. connectivity of SQL server 2000 with java

connectivity of SQL server 2000 with java

Scheduled Pinned Locked Moved Java
javadatabasesql-serversysadmin
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gaurav raghu
    wrote on last edited by
    #1

    Front end of my project is JSP and i'm suppose to use SQl Server as the database for the project so please provide my the code for the connectivity of java with sql server...

    I R 2 Replies Last reply
    0
    • G gaurav raghu

      Front end of my project is JSP and i'm suppose to use SQl Server as the database for the project so please provide my the code for the connectivity of java with sql server...

      I Offline
      I Offline
      ISoftwareDev
      wrote on last edited by
      #2

      Your best bet would be to have servlets or some other Java based backend (JSF for example) instead of connecting to the database directory from within JSF. You can then use standard JDBC to connect to the database. If you want to connect to SQL Server, the jTDS driver is one of the best.

      1 Reply Last reply
      0
      • G gaurav raghu

        Front end of my project is JSP and i'm suppose to use SQl Server as the database for the project so please provide my the code for the connectivity of java with sql server...

        R Offline
        R Offline
        raheela123
        wrote on last edited by
        #3

        import java.sql.*; Class.forName(sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:DSN);// DSN(Data Source Name) Statement st=con.createStatement(); st.executeUpdate("insert query"); // Retrieve datas ResultSet rs=st.executeQuery("query"); while(rs.next()) { String name=rs.getString(1); int age=rs.getInt(2); } ;P

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups