nguyenbahuong / smslib

Automatically exported from code.google.com/p/smslib
0 stars 0 forks source link

facing problem in stopping running service ... help me #516

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am using below function....i want to terminate the service automatically at 
end of this function...so using srv.stopService()...but its not working 
....help me

 public void send() throws Exception
    {

         Connection con = null;
         Service.getInstance().createGroup("Group");
        try {
            DBConnection db = new DBConnection();
            con = db.getConnection();
            PreparedStatement ps = con.prepareStatement("select mobno from regtbl");
            ResultSet rs = ps.executeQuery();
             while (rs.next()) {
                Service.getInstance().addToGroup("group", rs.getString(1));
            }
            con.close();

            GsmModem gsmModem = new GsmModem();
        GsmModem.configModem(port, bitRate, modemName, modemPin, SMSC);

       gsmModem.Sender("Group", getDesc());  //(tp, msg)

        srv.stopService();
        }

         catch (SQLException ex) {
            Logger.getLogger(noticeBean.class.getName()).log(Level.SEVERE, null, ex);
        }

    }

Original issue reported on code.google.com by ntn.deve...@gmail.com on 12 Oct 2012 at 10:43

GoogleCodeExporter commented 9 years ago
Sorry, but I can't check something if you have code that's hidden behind your 
custom calls
...
What's "gsmModem.Sender()" ?

Original comment by admin@smslib.org on 13 Oct 2012 at 10:05