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 MySQL with java

connectivity of MySQL with java

Scheduled Pinned Locked Moved Java
javadatabasemysqlquestion
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

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection cn=DriverManager.getConnection("jdbc:odbc:gaurav","",""); String sql="SELECT * FROM optrdata WHERE name=? ANd password=?"; PreparedStatement pst=cn.prepareStatement(sql); pst.setString(1,t2.getText().trim()); pst.setString(2,t3.getText().trim()); THE ABOVE LINE OF CODE CONNECTS JAVA WITH FORXPRO NOW I WANT TO USE THE SAME CODE CONNECTED TO MY SQL PLEASE GIVE ME THE CODE FOR THE CONNECTIVITY OF MYSQL WITH JAVA....

    F I 2 Replies Last reply
    0
    • G gaurav raghu

      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection cn=DriverManager.getConnection("jdbc:odbc:gaurav","",""); String sql="SELECT * FROM optrdata WHERE name=? ANd password=?"; PreparedStatement pst=cn.prepareStatement(sql); pst.setString(1,t2.getText().trim()); pst.setString(2,t3.getText().trim()); THE ABOVE LINE OF CODE CONNECTS JAVA WITH FORXPRO NOW I WANT TO USE THE SAME CODE CONNECTED TO MY SQL PLEASE GIVE ME THE CODE FOR THE CONNECTIVITY OF MYSQL WITH JAVA....

      F Offline
      F Offline
      fly904
      wrote on last edited by
      #2

      gaurav raghu wrote:

      PLEASE GIVE ME THE CODE

      NO! HAVE YOU EVER HEARD OF GOOGLE[^]??? AND NOT TYPING LAZY DEMANDS IN CAPITALS!

      My failometer is detecting vast quantities of FAIL! "Its SQL - hardly programming..." (Caslen)

      1 Reply Last reply
      0
      • G gaurav raghu

        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection cn=DriverManager.getConnection("jdbc:odbc:gaurav","",""); String sql="SELECT * FROM optrdata WHERE name=? ANd password=?"; PreparedStatement pst=cn.prepareStatement(sql); pst.setString(1,t2.getText().trim()); pst.setString(2,t3.getText().trim()); THE ABOVE LINE OF CODE CONNECTS JAVA WITH FORXPRO NOW I WANT TO USE THE SAME CODE CONNECTED TO MY SQL PLEASE GIVE ME THE CODE FOR THE CONNECTIVITY OF MYSQL WITH JAVA....

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

        Since you're using the JDBC-ODBC bridge, the same code will work to connect to almost any database. You just need to change your ODBC datasource connection.

        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