Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)

Stella981
• 阅读 544

Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)

第一步:在xml文件上界面布局
这边采用LinearLayour布局,添加3个按钮来实现界面的跳转,代码如下:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MainActivity">
    <Button
        android:id="@+id/b1"
        android:layout_marginTop="50dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="内置存储"/>

    <Button
        android:id="@+id/b6"
        android:layout_marginTop="50dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textAllCaps="false"
        android:text="SharedPreferences存储"/>

    <Button
        android:id="@+id/b7"
        android:layout_marginTop="50dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textAllCaps="false"
        android:text="SQLite存储"/>
        
</LinearLayout>

界面截图:
Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)
第二步:在Mainactivity.java完成功能的实现
找到ID并绑定
Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储) 3个按钮的监听事件(界面的跳转)

        b1.setOnClickListener(new View.OnClickListener() {
   
   
            @Override
            public void onClick(View view) {
   
   
                Intent intent=new Intent(MainActivity.this,Main2Activity.class);
                startActivity(intent);
            }
        });
        b6.setOnClickListener(new View.OnClickListener() {
   
   
            @Override
            public void onClick(View view) {
   
   
                Intent intent=new Intent(MainActivity.this,Main3Activity.class);
                startActivity(intent);
            }
        });
        b7.setOnClickListener(new View.OnClickListener() {
   
   
            @Override
            public void onClick(View view) {
   
   
                Intent intent=new Intent(MainActivity.this,Main4Activity.class);
                startActivity(intent);
            }
        });

第三步:各功能的实现
①、内部文件存储
创建一个xml文件(activity_main2)和一个java文件(Main2Activity),来实现内部文件存储界面的布局和功能的实现。
第一:这边的布局采用LinearLayout布局,首先添加一个EditText控件来输入我们要保存的信息,在添加3个按钮的实现不同的功能,点击第一个按钮把当前输入的信息保存到手机内部文件夹上,第二个按钮打开当前文件夹显示保存的信息,第三个按钮删除手机内部文件夹下所保存的文件,代码如下:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".Main2Activity">
    <EditText
        android:id="@+id/e1"
        android:layout_marginTop="50dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="20dp" />
    <Button
        android:id="@+id/b2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="30dp"
        android:text="保存信息"/>
    <Button
        android:id="@+id/b3"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="获取信息"/>
    <Button
        android:id="@+id/b4"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="删除文件"/>
    <TextView
        android:id="@+id/t1"
        android:layout_width="match_parent"
        android:textSize="30sp"
        android:layout_marginTop="20dp"
        android:text=""
        android:gravity="center"
        android:layout_height="wrap_content"/>

</LinearLayout>

界面截图:
Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)
第二:内部文件存储功能的实现

  • 获取到当前的id并绑定

Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)

  • 3个按钮的监听事件

按钮1(b2)保存信息

        b2.setOnClickListener(new View.OnClickListener() {
   
   
            @Override
            public void onClick(View view) {
   
   
                try {
   
   

                }
                catch (Exception e)
                {
   
   
                    e.printStackTrace();
                }
                }

        });


        b2.setOnClickListener(new View.OnClickListener() {
   
   
            @Override
            public void onClick(View view) {
   
   
                try {
   
   
                    OutputStream outputStream=openFileOutput("myfile",MODE_PRIVATE);
                    //MODE_PRIVATE,覆盖原有的文件;MODE_APPEND,内容追加到原来的文件上。
                    if(e1.getText().toString().equals(""))
                    {
   
   
                        Toast.makeText(Main2Activity.this,"当前为空,请输入信息",Toast.LENGTH_SHORT).show();
                        return;
                    }
                        outputStream.write(e1.getText().toString().getBytes());
                        outputStream.flush();;
                        outputStream.close();
                        Toast.makeText(Main2Activity.this,"保存信息成功",Toast.LENGTH_SHORT).show();
                }
                catch (Exception e)
                {
   
   
                    e.printStackTrace();
                    Toast.makeText(Main2Activity.this,"保存信息成功失败",Toast.LENGTH_SHORT).show();
                }
                }

        });

按钮2(b3)获取信息

        b3.setOnClickListener(new View.OnClickListener() {
   
   
            @Override
            public void onClick(View view) {
   
   
                try {
   
   
                    
                }
                catch (Exception e)
                {
   
   
                    e.printStackTrace();
                }
            }
        });


        b3.setOnClickListener(new View.OnClickListener() {
   
   
            @Override
            public void onClick(View view) {
   
   
                StringBuffer stringBuffer=new StringBuffer();
                try {
   
   
                   InputStream inputStream=openFileInput("myfile");
                   BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(inputStream));
                   String cout=null;
                   while((cout=bufferedReader.readLine())!=null)
                   {
   
   
                       stringBuffer.append(cout);
                   }
                   Toast.makeText(Main2Activity.this,"获取信息成功",Toast.LENGTH_SHORT).show();
                   t1.setText(stringBuffer.toString());
                   bufferedReader.close();
                }
                catch (Exception e)
                {
   
   
                    e.printStackTrace();
                    Toast.makeText(Main2Activity.this,"获取信息失败",Toast.LENGTH_SHORT).show();
                }
            }
        });

按钮3(b4)删除文件

 b4.setOnClickListener(new View.OnClickListener() {
   
   
            @Override
            public void onClick(View view) {
   
   
                boolean b=deleteFile("myfile");
                if(b==true)
                {
   
   
                    Toast.makeText(getApplicationContext(), "删除文件成功", Toast.LENGTH_SHORT).show();
                }
                else
                {
   
   
                    Toast.makeText(getApplicationContext(), "删除文件失败", Toast.LENGTH_SHORT).show();
                }
            }
        });

界面截图:
Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)
②、SharedPreferences存储
创建一个xml文件(activity_main3)和一个java文件(Main3Activity),来实现内部文件存储界面的布局和功能的实现。
第一:这边的布局采用LinearLayout布局,首先添加两个EditText控件来输入账号和密码,在添加3个按钮的实现不同的功能,点击第一个按钮注册账号,第二个按钮重新输入信息,第三个按钮登陆账号,代码如下:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:gravity="center"
    tools:context=".Main3Activity">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="20dp"
        android:textSize="20sp"
        android:text="用户名:"/>
        <EditText
            android:id="@+id/username"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="请输入账号"
            android:singleLine="true" />
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="20dp"
        android:orientation="horizontal">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="20dp"
            android:textSize="20sp"
            android:text="密码:"/>
        <EditText
            android:id="@+id/password"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="请输入密码"
            android:inputType="textPassword"
            android:singleLine="true" />
    </LinearLayout>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:orientation="horizontal">
    <Button
        android:id="@+id/login"
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_gravity="center"
        android:layout_height="wrap_content"
        android:text="注册"/>
    <Button
        android:id="@+id/delect"
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="wrap_content"
        android:layout_marginLeft="20dp"
        android:text="重新输入"/>

</LinearLayout>
    <Button
        android:id="@+id/see"
        android:layout_width="100dp"
        android:layout_marginTop="20dp"
        android:layout_height="wrap_content"
        android:text="登陆"/>
</LinearLayout>

界面截图:
Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)
第二:SharedPreferences存储功能的实现

  • 获取到当前的id并绑定
    Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)

  • 定义一个SharedPreferences
    Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)

    private SharedPreferences sharedPreferences;
    
  • 3个按钮的监听事件

按钮1(login)注册账号

        login.setOnClickListener(new View.OnClickListener() {
   
   
            @Override
            public void onClick(View view) {
   
   
                if(username.getText().toString().equals("")||password.getText().toString().equals(""))
                {
   
   
                    Toast.makeText(Main3Activity.this,"不能为空!",Toast.LENGTH_SHORT).show();
                    return;
                }
                sharedPreferences=getSharedPreferences("data",Context.MODE_PRIVATE);
                SharedPreferences.Editor editor=sharedPreferences.edit();
                editor.putString("username",username.getText().toString());
                editor.putString("password",password.getText().toString());
                editor.apply();
                Toast.makeText(Main3Activity.this,"注册成功!",Toast.LENGTH_SHORT).show();
            }
        });

按钮2(delect)删除文件,重新输入

        delect.setOnClickListener(new View.OnClickListener() {
   
   
            @Override
            public void onClick(View view) {
   
   
                SharedPreferences.Editor editor=sharedPreferences.edit();
                editor.clear();
                editor.apply();
                username.setText("");
                password.setText("");
                Toast.makeText(Main3Activity.this,"重新输入",Toast.LENGTH_SHORT).show();
            }
        });

按钮3(see)跳转到登陆账号界面
创建一个xml文件(activity_main5)和一个java文件(Main5Activity),来实现登陆账号功能
第一:这边的布局采用LinearLayout布局,首先添加两个EditText控件来输入账号和密码,在添加1个按钮的实现账号登陆,代码如下:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:gravity="center"
    tools:context=".Main5Activity">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="20dp"
        android:orientation="horizontal">
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="20sp"
        android:text="账号:"/>
        <EditText
            android:id="@+id/zh1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="20sp"
            android:text=""/>
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="20dp"
        android:orientation="horizontal">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="20sp"
            android:text="密码:"/>
        <EditText
            android:id="@+id/mm1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="20sp"
            android:text=""/>
    </LinearLayout>
    <Button
        android:id="@+id/success"
        android:layout_width="100dp"
        android:layout_height="wrap_content"
        android:text="确认"/>
</LinearLayout>

界面截图:
Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)
第二:功能实现(Main5Activity)
获取到当前的id并绑定
Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)
获取注册过的账号和密码
Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)
按钮的监听事件(判断账号密码是否为空和账号密码是否存在)

success.setOnClickListener(new View.OnClickListener() {
   
   
            @Override
            public void onClick(View view) {
   
   
                if(zh1.getText().toString().equals("")||mm1.getText().toString().equals(""))
                {
   
   
                    Toast.makeText(Main5Activity.this,"不能为空!",Toast.LENGTH_SHORT).show();
                    return;
                }
                else if(zh1.getText().toString().equals(userzh)&&mm1.getText().toString().equals(usermm))
                {
   
   
                    Toast.makeText(Main5Activity.this,"登陆成功",Toast.LENGTH_SHORT).show();
                }
                else
                {
   
   
                    Toast.makeText(Main5Activity.this,"账号或密码错误",Toast.LENGTH_SHORT).show();
                }

            }
        });

界面截图:
Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)
③、SQLite存储
创建一个xml文件(activity_main4)和一个java文件(Main4Activity),来实现SQLite存储界面的布局和功能的实现。
第一:这边的布局采用LinearLayout布局,首先添加两个EditText控件来输入账号和密码,在添加2个按钮的实现不同的功能,点击第一个按钮注册账号,第二个按钮重新输入,之后在定义两个TextView来显示注册的账号密码,代码如下:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:gravity="center"
    tools:context=".Main4Activity">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="20dp"
            android:textSize="20sp"
            android:text="用户名:"/>
        <EditText
            android:id="@+id/usernames"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="请输入账号"
            android:singleLine="true" />
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="20dp"
        android:orientation="horizontal">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="20dp"
            android:textSize="20sp"
            android:text="密码:"/>
        <EditText
            android:id="@+id/passwords"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="请输入密码"
            android:inputType="textPassword"
            android:singleLine="true" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:orientation="horizontal">
        <Button
            android:id="@+id/register"
            android:layout_width="100dp"
            android:layout_gravity="center"
            android:layout_height="wrap_content"
            android:text="注册"/>
        <Button
            android:id="@+id/again"
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:text="重新输入"/>
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:layout_marginTop="50dp"
        android:orientation="horizontal">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="20sp"
            android:text="账号:"/>
        <TextView
            android:id="@+id/zh"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="20sp"
            android:text=""/>
        <TextView

            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="50dp"
            android:textSize="20sp"
            android:text="密码:"/>
        <TextView
            android:id="@+id/mm"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="20sp"
            android:text=""/>
    </LinearLayout>

</LinearLayout>

界面截图:
Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)
第二:创建数据库文件(MyDateBase)

public class MyDateBase  {
   
   
    
}

继承SQLiteOpenHelper

public class MyDateBase extends SQLiteOpenHelper {
   
   

}

鼠标移至SQLiteOpenHelper按下Alt+Enter,选择第一个,之后按下ok
Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)
Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)
鼠标移至SQLiteOpenHelper按下Alt+Enter,选择第一个,之后按下ok
Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)
创建一个命名为first的数据表(id,username,password)

private String createAppTable="create table first(id integer primary key autoincrement,username varchar(20),password varchar(20))";

在onCreate函数中执行SQL语句

sqLiteDatabase.execSQL(createAppTable);
sqLiteDatabase.execSQL("insert into first(id,username,password) values(?,?,?)",new String[]{
   
   "1","",""});
System.out.println("创建数据库成功");

根据Id找到账号和密码并更新账号和密码,在倒数第二个花括号添加类

 public String getusernameById(SQLiteDatabase db,String id)//根据Id找到账号
    {
   
   
        Cursor cursor=db.rawQuery("select * from first where id=?",new String[]{
   
   id});
        if(cursor.moveToNext())
        {
   
   
            return cursor.getString(cursor.getColumnIndex("username"));
        }
        return "";
    }
    public void updateusername(SQLiteDatabase db,String id,String username)//更新账号
    {
   
   
        db.execSQL("update first set username=? where id=?",new String[]{
   
   username,id});
    }

    public String getpasswordById(SQLiteDatabase db,String id)//根据Id找到密码
    {
   
   
        Cursor cursor=db.rawQuery("select * from first where id=?",new String[]{
   
   id});
        if(cursor.moveToNext())
        {
   
   
            return cursor.getString(cursor.getColumnIndex("password"));
        }
        return "";
    }
    public void updatepassword(SQLiteDatabase db,String id,String password)//更新密码
    {
   
   
        db.execSQL("update first set password=? where id=?",new String[]{
   
   password,id});
    }
    public  void delectdb(SQLiteDatabase db,String id)//删除数据表中的信息
    {
   
   
        db.execSQL("delete from first where id=?",new String[]{
   
   id});
    }

第三:返回Main4Activity文件,实现功能的实现
获取到当前的id并绑定
Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)
并添加SQLiteDatabase和MyDateBase
Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)
访问数据表
Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)
更新用户名和密码

public void UpdateUserName()//更新账号
    {
   
   
        myDateBase.updateusername(db,"1",usernames.getText().toString());
    }
public void UpdatePassWord()//更新密码
    {
   
   
        myDateBase.updatepassword(db,"1",passwords.getText().toString());
    }

按钮的监听事件

        register.setOnClickListener(new View.OnClickListener() {
   
   
            @Override
            public void onClick(View view) {
   
   
                if(passwords.getText().toString().equals("")||usernames.getText().toString().equals(""))
                {
   
   
                    Toast.makeText(Main4Activity.this,"注册失败,不能为空!",Toast.LENGTH_SHORT).show();
                    return;
                }
                UpdateUserName();
                UpdatePassWord();
                Toast.makeText(Main4Activity.this,"注册成功!",Toast.LENGTH_SHORT).show();
                zh.setText(usernames.getText().toString());
                mm.setText(passwords.getText().toString());
            }
        });
        again.setOnClickListener(new View.OnClickListener() {
   
   
            @Override
            public void onClick(View view) {
   
   
                usernames.setText("");
                passwords.setText("");
            }
        });

获取账号和密码并显示

    public void getUserName() {
   
   //获取用户名
        String user=myDateBase.getusernameById(db, "1");
        zh.setText(user);
    }
    public void getPassword() {
   
   //获取密码
        String pass=myDateBase.getpasswordById(db, "1");
        mm.setText(pass);
    }

Android 3种数据保存(SharedPreferences存储 内部文件存储 数据库存储)
删除数据表的信息

public void DelectDb()
    {
   
   
        myDateBase.delectdb(db,"1");
    }

本项目的源代码链接:

点赞
收藏
评论区
推荐文章
blmius blmius
2年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Jacquelyn38 Jacquelyn38
2年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
Stella981 Stella981
2年前
KVM调整cpu和内存
一.修改kvm虚拟机的配置1、virsheditcentos7找到“memory”和“vcpu”标签,将<namecentos7</name<uuid2220a6d1a36a4fbb8523e078b3dfe795</uuid
Easter79 Easter79
2年前
Twitter的分布式自增ID算法snowflake (Java版)
概述分布式系统中,有一些需要使用全局唯一ID的场景,这种时候为了防止ID冲突可以使用36位的UUID,但是UUID有一些缺点,首先他相对比较长,另外UUID一般是无序的。有些时候我们希望能使用一种简单一些的ID,并且希望ID能够按照时间有序生成。而twitter的snowflake解决了这种需求,最初Twitter把存储系统从MySQL迁移
Wesley13 Wesley13
2年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
2年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Stella981 Stella981
2年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable
Wesley13 Wesley13
2年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
3个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这