Complete CRUD Operations in Android Studio with SQL Stored Procedure | ProgrammingGeek

Описание к видео Complete CRUD Operations in Android Studio with SQL Stored Procedure | ProgrammingGeek

Complete CRUD Operations in Android Studio with SQL Stored Procedure. This tutorial teaches you to perform CRUD operation in android studio with SQL stored procedure using java code. This tutorial helps you to learn complete CRUD operation in Android Studio with MS SQL Server using Java Code. This is the easiest way to perform crud operation in android studio with SQL stored procedure. So, all the create, retrieve, update and delete operation has been performed in SQL. Finally call the stored procedure to android project. Thats all.

Just follow these steps to perform crud operation in android studio-
1. Create a new project in Android Studio.
2. Design the project with TextView, editTextNumber, editTextText and button control.
3. Create database, table in SQL Server and create Stored Procedure with the table.
4. Connect SQL server with Android Studio.
5. Write code to execute CRUD operation in Android Studio.

Prerequisites.
You should have installed SQL server and Android Studio.

This tutorial also covered-
1. Creating new Android project in visual studio.
2. Creating SQL server Stored Procedure.
6. Connecting SQL server with Android Studio.

Source Code Sample
public void onClick(View v) {
Connection con = ConnectionClass();

try {
if(con !=null) {
String Q = "exec dbo.Insert_User_SP '" + id.getText().toString() + "','" + name.getText().toString() + "','" + address.getText().toString() + "' ";
Statement statement = con.createStatement();
ResultSet result = statement.executeQuery(Q);
msg.setText("Successfully Added");

}
else {
msg.setText("Error in connection");
}
}
catch (Exception ex){
Log.e("Set Error",ex.getMessage());
}
}

Connection Class
@SuppressLint("NewApi")
public Connection ConnectionClass()
{
String ip="192.16.25.2", port="30661", dbname="CRUDAndroidDB", dbuser ="sa", dbpass="r12345";
StrictMode.ThreadPolicy policy= new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);

Connection connection=null;
String connectURL=null;

try {
Class.forName("net.sourceforge.jtds.jdbc.Driver");
String connectionUrl = "jdbc:jtds:sqlserver://" + ip + ":" + port + ";databasename=" + dbname + ";User=" + dbuser + ";password=" + dbpass + ";";
connection= DriverManager.getConnection(connectionUrl);
}
catch (Exception ex){
Log.e("Set Error",ex.getMessage());
}
return connection;
}

------
This channel covers all the programming tutorial related with .Net- C#, linq, VB, SQL, Android, HTML, CSS, jQuery, Crystal Report and Microsoft Report.
So, Please subscribe and keep in touch.
   / programminggeek  

Visit my page in Facebook
  / programminggeek7  
------
More Tags

#CRUDInAndroidWithSQL #CRUD #InserDeleteUpdateSearch #androidstudio #sql #programminggeek #androidstudiojava #androidstudiotutorial

programminggeek,
crud android studio sql,
complete crud operation in android studio with sql,
crud operation in android studio java,
android crud operation,
android crud application tutorial,
crud sql stored procedure in android studion

Комментарии

Информация по комментариям в разработке