简体   繁体   中英

Using sqlite3 database in Android Application

Hey guys I am trying to use sqlite3 database to use in this android application I am making. We have a database we made that has the bus schedule and the bus stops So the queries like this

SELECT DISTINCT M.departure_time, N.trip_headsign
FROM mt_stop_time M, mt_trip N
WHERE (M.stop_id=8338) AND (M.trip_id = N.trip_id) AND (M.day = 'su') 
AND (M.departure_time < 18) AND (M.departure_time >= 15) AND M.trip_id LIKE '%2010_11%' ORDER BY trip_headsign ASC;

will return something like

17:26:00 1 SPRING GARDEN TO DARTMOUTH
17:41:00 1 SPRING GARDEN TO DARTMOUTH
17:56:00 1 SPRING GARDEN TO DARTMOUTH
15:26:00 10 WESTPHAL
16:26:00 10 WESTPHAL
17:26:00 10 WESTPHAL
15:13:00 14 DOWNTOWN
16:13:00 14 DOWNTOWN
17:17:00 80 HALIFAX
17:47:00 80 HALIFAX

It shows the Time, bus #, destination So my question is how can I call sqlite3 through Java so I can use these informations for my application to show up the bus schedule time once the user clicks the bus stops?

Thanks

看看android docs中的“使用数据库”文档。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM