com.j256.ormlite.android
Class AndroidConnectionSource

java.lang.Object
  extended by com.j256.ormlite.support.BaseConnectionSource
      extended by com.j256.ormlite.android.AndroidConnectionSource
All Implemented Interfaces:
com.j256.ormlite.support.ConnectionSource

public class AndroidConnectionSource
extends com.j256.ormlite.support.BaseConnectionSource
implements com.j256.ormlite.support.ConnectionSource

Android version of the connection source. Takes a standard Android SQLiteOpenHelper. For best results, use OrmLiteSqliteOpenHelper. You can also construct with a SQLiteDatabase.

Author:
kevingalligan, graywatson

Constructor Summary
AndroidConnectionSource(android.database.sqlite.SQLiteDatabase sqliteDatabase)
           
AndroidConnectionSource(android.database.sqlite.SQLiteOpenHelper helper)
           
 
Method Summary
 void clearSpecialConnection(com.j256.ormlite.support.DatabaseConnection connection)
           
 void close()
           
 void closeQuietly()
           
 com.j256.ormlite.db.DatabaseType getDatabaseType()
           
 com.j256.ormlite.support.DatabaseConnection getReadOnlyConnection()
           
 com.j256.ormlite.support.DatabaseConnection getReadWriteConnection()
           
 boolean isOpen()
           
 void releaseConnection(com.j256.ormlite.support.DatabaseConnection connection)
           
 boolean saveSpecialConnection(com.j256.ormlite.support.DatabaseConnection connection)
           
 String toString()
           
 
Methods inherited from class com.j256.ormlite.support.BaseConnectionSource
clearSpecial, getSavedConnection, getSpecialConnection, isSavedConnection, saveSpecial
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.j256.ormlite.support.ConnectionSource
getSpecialConnection
 

Constructor Detail

AndroidConnectionSource

public AndroidConnectionSource(android.database.sqlite.SQLiteOpenHelper helper)

AndroidConnectionSource

public AndroidConnectionSource(android.database.sqlite.SQLiteDatabase sqliteDatabase)
Method Detail

getReadOnlyConnection

public com.j256.ormlite.support.DatabaseConnection getReadOnlyConnection()
                                                                  throws SQLException
Specified by:
getReadOnlyConnection in interface com.j256.ormlite.support.ConnectionSource
Throws:
SQLException

getReadWriteConnection

public com.j256.ormlite.support.DatabaseConnection getReadWriteConnection()
                                                                   throws SQLException
Specified by:
getReadWriteConnection in interface com.j256.ormlite.support.ConnectionSource
Throws:
SQLException

releaseConnection

public void releaseConnection(com.j256.ormlite.support.DatabaseConnection connection)
Specified by:
releaseConnection in interface com.j256.ormlite.support.ConnectionSource

saveSpecialConnection

public boolean saveSpecialConnection(com.j256.ormlite.support.DatabaseConnection connection)
                              throws SQLException
Specified by:
saveSpecialConnection in interface com.j256.ormlite.support.ConnectionSource
Throws:
SQLException

clearSpecialConnection

public void clearSpecialConnection(com.j256.ormlite.support.DatabaseConnection connection)
Specified by:
clearSpecialConnection in interface com.j256.ormlite.support.ConnectionSource

close

public void close()
Specified by:
close in interface com.j256.ormlite.support.ConnectionSource

closeQuietly

public void closeQuietly()
Specified by:
closeQuietly in interface com.j256.ormlite.support.ConnectionSource

getDatabaseType

public com.j256.ormlite.db.DatabaseType getDatabaseType()
Specified by:
getDatabaseType in interface com.j256.ormlite.support.ConnectionSource

isOpen

public boolean isOpen()
Specified by:
isOpen in interface com.j256.ormlite.support.ConnectionSource

toString

public String toString()
Overrides:
toString in class Object


This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.