5 Replies Latest reply: Jul 9, 2013 4:37 AM by PhHein RSS

    s.v.p aide !! uncompatible code !

    6e13397b-6d56-4f97-89b8-8a99959fb072

      import java.sql.*;

      public class database {

          Connection con;

          Statement st;

          ResultSet rs;

           public db(){

               connect();

           }

           public void connect(){

               try{

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

                   Class.forName(driver);

                   String database = "jdbc:odbc:database1";

                   con = DriverManager.getConnection(database);

                   st = con.createStatement();

                   String sql="select * from table_status";

                   rs = st.executeQuery(sql);

                    while(rs.next())

                    {

                        String ne = rs.getString("NE(public info)");

                        String netype = rs.getString("NE Type(public info)");

                        String version = rs.getString("version");

                        String patch = rs.getString("patch)");

                        String port = rs.getString("port");

                        String portstate = rs.getString("port_state");

                        String bandwidth = rs.getString("bandwidth");

                        String bandwidthutilize = rs.getString("bandwidth_utilize");

                        String vendorname = rs.getString("vendor_name");

                        String distance = rs.getString("distance");

                        String rxpower = rs.getString("RxPower");

                        String txpower = rs.getString("TxPower");

                        String checknode = rs.getString("check_node");

                        String sectionalarm = rs.getString("section alarm");

                        String linealarm = rs.getString("line alarm");

                        String pathalarm = rs.getString("path alarm");

                        String b1increase = rs.getString("B1_increase");

                        String b2increase = rs.getString("B2_increase");

                        String reilineincrease = rs.getString("REI(line)_increase");

                        String b3increase = rs.getString("B3_increase");

                        String reipathincrease = rs.getString("REI(path)_increase");

                        String clockmode = rs.getString("clock_mode");

                        String wanalarm = rs.getString("WAN alarm");

                        String crcincrease = rs.getString("CRC_increase");

                        String symbolincrease = rs.getString("Symbol_increase");

                        String rxpauseincrease = rs.getString("RxPause_increase");

                        String txpauseincrease= rs.getString("TxPause_increase");

                 

                       System.out.println(ne+" "+netype+" "+version+" "+patch+" "+port+" "+portstate+" "+bandwidth+" "

                               +bandwidthutilize+" "+vendorname+" "+distance+" "+rxpower+" "+txpower+" "+checknode+" "+sectionalarm+" "

                               +linealarm+" "+pathalarm+" "+b1increase+" "+b2increase+" "+reilineincrease+" "+b3increase+" "+reipathincrease

                               +" "+clockmode+" "+wanalarm+" "+crcincrease+" "+symbolincrease+" "+rxpauseincrease+" "+txpauseincrease);

                    }

                   }

           }catch(Exception ex){

           }

          

        public static void main(String[] args) {

        new database;

        } }