JDBC - Please light my Sky

  • Hello, guys!!

    Finally I have my replication done and now I have the data avaliable for my Java application.

    I think that the fist step is establish a connection between SQL Server and Java.

    I heard JDBC but I hava SQL SErver 7

    Any good article to light my sky???

    Thanks,

    Claudia


    Regards,

    Cláudia Rego

    www.footballbesttips.com

  • Try this:

    <%@ page import="java.sql.*"  %>

    String driver = "sun.jdbc.odbc.JdbcOdbcDriver";

    String url = "jdbc:odbc:{your sql server name here}";

    String sSQL;

    ResultSet rs = null;

    String intrnalfield;

    Build your sSQL string

    in a try block

        Class.forName(driver);

        con = DriverManager.getConnection(url, user, password);

        stmt = con.createStatement();

        rs = stmt.executeQuery(sSQL);

        while (rs.next()) {

           internalfield = (rs.getString("{SQL_Field_Name}"));

     }

        rs.close();

    Note: user and password is for the SQL User

    items in red should be replaced with appropriate names

  • The ODBC bridge is a last resort. No one involved in making the product recommends that it be used for production work.

    When we dumpled CrystalReports in favour of something which actually works, we also bought into their JDBC driver. See http://www.inetsoftware.de/ While I haven't used SQL7 in a long time, when we first made the transition the Opta driver worked in that environment too.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply