Package com.baremaps.iploc.database
Class InetnumLocationDaoSqliteImpl
java.lang.Object
com.baremaps.iploc.database.InetnumLocationDaoSqliteImpl
- All Implemented Interfaces:
Dao<InetnumLocation>,InetnumLocationDao
Data access object for Sqlite JDBC to the inetnum_locations table
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(InetnumLocation inetnumLocation) Delete the given elementfindAll()Find all the elementsfindByIp(byte[] ip) Find the inetnum location by ipfindOne(long id) Find the element with the given idGet a connection to the database file in read onlyGet a connection to the database file in read onlyvoidsave(InetnumLocation inetnumLocation) Save the given elementvoidsave(List<InetnumLocation> inetnumLocations) Save the given list of inetnum locationsvoidupdate(InetnumLocation inetnumLocation, String[] params) Update the given element
-
Constructor Details
-
InetnumLocationDaoSqliteImpl
Init the datasources- Parameters:
url-
-
-
Method Details
-
getReadConnection
Get a connection to the database file in read only- Returns:
- Throws:
SQLException
-
getWriteConnection
Get a connection to the database file in read only- Returns:
- Throws:
SQLException
-
findOne
Find the element with the given id- Specified by:
findOnein interfaceDao<InetnumLocation>- Parameters:
id- the id of the element to find- Returns:
- the optional element
-
findAll
Find all the elements- Specified by:
findAllin interfaceDao<InetnumLocation>- Returns:
- the list of all the elements
-
findByIp
Find the inetnum location by ip- Specified by:
findByIpin interfaceInetnumLocationDao- Parameters:
ip- the ip to search on 4 bytes- Returns:
- the list of locations that matched
-
save
Save the given element- Specified by:
savein interfaceDao<InetnumLocation>- Parameters:
inetnumLocation- the element to save
-
save
Save the given list of inetnum locations- Specified by:
savein interfaceInetnumLocationDao- Parameters:
inetnumLocations- the list of inetnum locations to save
-
update
Update the given element- Specified by:
updatein interfaceDao<InetnumLocation>- Parameters:
inetnumLocation- the element to updateparams- the list of fields to update
-
delete
Delete the given element- Specified by:
deletein interfaceDao<InetnumLocation>- Parameters:
inetnumLocation- the element to delete
-