public void dbConnect(String db_connect_string, String db_userid, String db_password) { String x=" "; try { try{ Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); } catch (Exception e) { x +=" 1 "; } x+= " befor cpm "; Connection conn = DriverManager.getConnection(db_connect_string, db_userid, db_password); x+= " conne "; System.out.println("connected"); Statement statement = conn.createStatement(); String queryString = "select * from A_Users"; Cursor rs = (Cursor) statement.executeQuery(queryString); while (rs.moveToNext()) { // System.out.println(); x+=rs.getString(2); } conn.close(); } catch (SQLException e) { e.printStackTrace(); x +=e.getMessage() + " mostafa"; } EditText tex= (EditText) findViewById(R.id.editText1); tex.setText(x); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)