zoukankan      html  css  js  c++  java
  • RDBMS代码阅读笔记(一)

               

             RDBMS是一个用C语言实现的简单的能够使用SQL语言进行操作的数据库系统,作者是李露曦。下面我从程序开始的起点main函数开始阅读。

     

    /*msdb.c*/

     

    #include<stdio.h>

    #include<string.h>

    #include <time.h> 

    #include"compile.h"  

     

    void main()

    {

           char command[1024];    // 定义数组,命令行字符串

           int in=1;

           //time_t t;

        //time(&t);

           printf("欢迎进入RDBMS系统/n");

    /*欢迎界面*/     

    printf("*******************************************************************************   

       /n");

        printf("  w     w     w  w w w   w       w w w     w w w         w   w     w w w      

                 /n");

        printf("   w    w    w   w       w      w        w       w      w w w w    w          

                /n"); 

        printf("    w  w w  w    w w w   w     w         w       w     w  w w  w   w w w      

                 /n");

        printf("     w w w w     w       w      w        w       w    w    w    w  w          

                 /n");

     printf("      w   w      w w w   w w w   w w w     w w w     w     w     w w w w      

           /n");

       

    printf("********************************************************************************  

        /n");

             

                    

      printf("请输入命令!/n");  // 提示输入命令

    /*定义一个输入命令的循环*/

        do

        {

           

           printf("/nRDBMS>");

           gets(command);  // 输入命令

     /*运行SQL命令,in1表示执行失败,0表示成功*/

           in=compileSQL(command); // 执行命令,

           if(in){

           //  printf("/nError!/n"); //提示运行命令失败 

           }

         else

           {

               printf("/nOK!/n");    //提示运行命令成功

           }

        }while(1);

       

    }

       

        我感觉有一个问题是提示输入命令时应稍微提示输入sql命令的格式,虽然是控制台程序,但也应讲究一下人机交互。下一篇文章我将阅读compileSQL(command)函数的代码。

     

     

  • 相关阅读:
    Acwing 284.金字塔 (区间DP)
    Acwing 283.多边形 (区间DP)
    Acwing 277.饼干 (DP+排序不等式)
    Acwing 274.移动服务 (DP)
    Acwing 273.分级 (DP)
    Acwing 271.杨老师的照相排序 (DP)
    Acwing 272.最长公共上升子序列 (DP)
    Mybatis-缓存
    mybatis与spring整合
    mybatis-sql映射文件
  • 原文地址:https://www.cnblogs.com/lanzhi/p/6471318.html
Copyright © 2011-2022 走看看