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

Field Summary
 
Fields inherited from class com.j256.ormlite.support.BaseConnectionSource
usedSpecialConnection
 
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()
           
 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)
           
 
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, toString, 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()
Specified by:
getReadOnlyConnection in interface com.j256.ormlite.support.ConnectionSource

getReadWriteConnection

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

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

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


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