throw Android database SQL Exception - Android Database

Android examples for Database:Database Connection

Description

throw Android database SQL Exception

Demo Code


//package com.book2s;
import android.util.Log;
import java.sql.SQLException;

public class Main {
    public static void throwAndroidSQLException(String tag, SQLException e) {
        if (e != null) {
            try {
                String error = "" + e.getMessage();
                Log.e(tag, error, e);/* w  w w .  j a v  a 2s.c o  m*/
                throw new android.database.SQLException(error);
            } catch (Exception exception) {
            }
        }
    }
}

Related Tutorials