Uno se llama SimpleSelect.Java y me busca en una base de datos en SQL y el otro se llama ClientApp.Java y en un método averigua las direcciones Bluetooth de los dispositivos que se encuentren al alcance de mi computadora. Necesito que desde el metodo deviceDiscovered de ClientApp llame al main de SimpleSelect para que revise si esa direccion esta en mi BD.
El codigo de la clase deviceDiscovered es:
Código:
Y el codigo de SimpleSelect es:public synchronized void deviceDiscovered(RemoteDevice btDevice, DeviceClass cod) { devices[count++] = btDevice; System.out.println("New Device discovered : "+ btDevice.getBluetoothAddress()); }
Código:
No se como llamar al metodo main de SimpleSelect enviandole la direccion bluetooth..import java.io.*; import java.net.*; import java.sql.*; import java.util.*; public class SimpleSelect { public static void main(String args[]) throws IOException, java.sql.SQLException,ClassNotFoundException { String url= "jdbc:AvenirDriver://LE:1433/Bru_Dig;uid= sa;pwd=123 "; Class.forName ("net.avenir.jdbc3.Driver"); /*Registering the Driver*/ Connection ctn = DriverManager.getConnection(url,"sa",""); Statement stmt = ctn.createStatement(); //there should be a table table named TABLE1 in the database before executing this statement boolean moreResult = stmt.execute("select Nombre from Usuarios"); int updateCount = stmt.getUpdateCount(); ResultSet rst = null; /*Extracting the values of a particular column from a table*/ rst = stmt.getResultSet(); while(rst.next()) System.out.println(rst.getObject(1)); } }
Gracias de Antemano!!

Elsy