package com.bn.helper;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.widget.EditText;
public class DBUtil
{
static SQLiteDatabase sld;
static EditText et;
public static void createOrOpenDatabase() throws Exception
{
sld=SQLiteDatabase.openDatabase
(
"/data/data/com.bn.helper/sd.dbdb", //数据库所在路径
null, //CursorFactory
SQLiteDatabase.OPEN_READWRITE|SQLiteDatabase.CREATE_IF_NECESSARY //读写、若不存在则创建
);
String sql1="create table if not exists lines(L_number INTEGER(5),L_name varchar2(20),L_description varchar2(100))";
sld.execSQL(sql1);
String sql2="create table if not exists station(S_number INTEGER(5),S_name varchar(20),S_description varchar2(40),S_jd varchar2(20),S_wd varchar2(20))";
sld.execSQL(sql2);
String sql3="create table if not exists ls(XZ_id INTEGER(5),L_number INTEGER(5),S_number INTEGER(5),num INTEGER(3))";
sld.execSQL(sql3);
String sql4="create table if not exists linerevise(id INTEGER(5),num INTEGER(3),XZ_ID INTEGER(5),jd varchar2(20),wd varchar2(20))";
sld.execSQL(sql4);
String sql5="create table if not exists temp(num INTEGER(3),jd varchar2(20),wd varchar2(20))";
sld.execSQL(sql5);
String sql6="create table if not exists tranfrostop(id INTEGER(5),name varchar2(20),jd varchar2(20),wd varchar2(20),L_name varchar2(20))";
sld.execSQL(sql6);
}
public static void closeDatabase() throws Exception
{
sld.close();
}
//插入记录的方法
public static void insert()throws Exception
{
String[] sqlsb={
"insert into lines values(00002,'地铁2号线','')",
"insert into lines values(00001,'地铁1号线','')",
"insert into lines values(00013,'地铁13号线','')",
};
for(String sql:sqlsb)
{
sld.execSQL(sql);
}
String[] sqlsc={
"insert into station values(00001,'西直门站','','116.3551452636719','39.940277770390324')",
"insert into station values(00002,'车公庄站','','116.35594367980957','39.93191969562437')",
"insert into station values(00003,'阜成门站','','116.35637283325195','39.92290236029078')",
"insert into station values(00004,'长椿街站','','116.36332511901855','39.89910274087739')",
"insert into station values(00005,'宣武门站','','116.37439727783203','39.899497822790494')",
"insert into station values(00006,'和平门站','','116.38426780700683','39.89989290242579')",
"insert into station values(00007,'前门站','','116.39800071716308','39.89992582562591')",
"insert into station values(00008,'崇文门站','','116.4175271987915','39.900847668807245')",
"insert into station values(00009,'北京站','','116.42718315124512','39.90486412650293')",
"insert into station values(00010,'朝阳门站','','116.43469333648681','39.924350479594196')",
"insert into station values(00011,'东四十条站','','116.43435001373291','39.93343343839839')",
"insert into station values(00012,'东直门站','','116.43374919891357','39.941001650090925')",
"insert into station values(00013,'雍和宫站','','116.41705513000488','39.94909541971909')",
"insert into station values(00014,'鼓楼大街站','','116.39370918273926','39.94876642336431')",
"insert into station values(00015,'积水潭站','','116.37332439422607','39.94856902479194')",
"insert into station values(00016,'苹果园站','','116.1779308319098','39.92645678026888')",
"insert into station values(00017,'古城站','','116.19080543518066','39.907330022383197')",
"insert into station values(00018,'八宝山革命公墓站','','116.23582363128662','39.90730022383197')",
"insert into station values(00019,'玉泉路站','','116.25316143035888','39.90726730417519')",
"insert into station values(00020,'五棵松站','','116.27423286437988','39.907201464814136')",
"insert into station values(00021,'木樨地站','','116.33796215057373','39.907168545109904')",
"insert into station values(00022,'南礼士路站','','116.35268211364746','39.9070368661347')",
"insert into station values(00023,'复兴门站','','116.35667324066162','39.90713562538983')",
"insert into station values(00024,'西单站','','116.37439727783203','39.907201464814136')",
"insert into station values(00025,'天安门西站','','116.39182090759271','39.90733314347294')",
"insert into station values(00026,'天安门东站','','116.4016056060791','39.907596500031254')",
"insert into station values(00027,'王府井站','','116.4116907119751','39.90792569430544')",
"insert into station values(00028,'东单站','','116.42014503479004','39.908123210110666')",
"insert into station values(00029,'建国门站','','116.43593788146972','39.90845240185384')",
"insert into station values(00030,'永安门站','','116.45057201385498','39.908254886997746')",
"insert into station values(00031,'大望路站','','116.47679328918457','39.908024452279236')",
"insert into station values(00032,'四惠路站','','116.49906635284424','39.908419482750716')",
"insert into station values(00033,'四惠东站','','116.51618977519531','39.90832072534639')",
"insert into station values(00034,'高碑店站','','116.5325403213501','39.9091107805945')",
"insert into station values(00035,'双桥站','','116.57721519470215','39.9101312551376')",
"insert into station values(00036,'管庄站','','116.5995740890503','39.90897910535256')",
"insert into station values(00037,'八里桥站','','116.61828517913818','39.905687142046275')",
"insert into station values(00038,'通州北苑站','','116.63738250732422','39.903481438133426')",
"insert into station values(00039,'果园站','','116.64656639099121','39.893209165276026')",
"insert into station values(00040,'九棵树站','','116.65763854980469','39.89001522821706')",
"insert into station values(00041,'梨园站','','116.66853904724121','39.88359397660328')",
"insert into station values(00042,'临河里站','','116.6788387298584','39.87522898285956')",
"insert into station values(00043,'土桥站','','116.68664932250976','39.87177071491688')",
"insert into station values(00044,'西直门站','','116.3551452636719','39.940277770390324')",
"insert into station values(00045,'大钟寺站','','116.34512901306152','39.96652996217967')",
"insert into station values(00046,'知春路站','','116.34000062942505','39.97642948739513')",
"insert into station values(00047,'清华园站','','116.33914232254028','39.98261185212121')",
"insert into station values(00048,'五道口站','','116.33761882781982','39.99285427306812')",
"insert into station values(00049,'上地站','','116.32000207901001','40.03293783519874')",
"insert into station values(00050,'清河站','','116.31500244140625','40.041184995048646')",
"insert into station values(00051,'龙泽站','','116.31963729858398','40.07069902257262')",
"insert into station values(00052,'回龙观站','','116.33648157119751','40.07046913520271')",
"insert into station values(00053,'霍营站','','116.36128664016723','40.07056765845624')",
"insert into station values(00054,'北苑站','','116.43465042114258','40.04294272685822')",
"insert into station values(00055,'望京西站','','116.44604444503784','39.992788516034295')",
"insert into station values(00056,'芍药居站','','116.4361310005188','39.977843588238784')",
"insert into station values(00057,'光熙门站','','116.43190383911133','39.96825672678314')",
"insert into station values(00058,'柳芳站','','116.43267631530762','39.958191542192644')",
"insert into station values(00059,'东直门站','','116.43374919891357','39.941001650090925')",
CrMylive.
- 粉丝: 1w+
- 资源: 4万+
最新资源
- nuScenes-map-expansion-v1.3.zip
- 基于web的二手闲置交易系统源码(java毕业设计完整源码).zip
- 计算机专业学习-教程和学习方法
- 基于javaweb的淘狗管理系统.doc
- Sgmediation命令安装Stata命令中介效应Sobel检验附图文安装教程
- 基于web的助农商超网站的设计与实现源码(java毕业设计完整源码).zip
- 基于web的图书馆联盟信息采集系统.doc
- stm32数控buck同步整流电路 效率可达95%以上 电压电流采样 反馈电路采用软件增量式pi闭环控制,可以实现恒压闭环 驱动电路采用ir2104芯片驱动半桥 输出采样电路通过lm385进行放大反馈
- 基于web的医疗设备管理系统源码(java毕业设计完整源码).zip
- 基于web的图书馆预约管理系统.doc
- sqlyog 13.1.9 Trail (ultimate) pj版本
- python exe pyinstaller 适配 win7 onnx
- 打架图像分类数据集4类别:打、踢、推、拳击(28000张图片).rar
- 物流规划自动化立体仓库的规划与评估
- 基于Java技术的图书馆占座系统的设计与实现
- 基于Web的医院挂号预约管理系统的设计与实现源码(java毕业设计完整源码).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈