从数据库中取数据(Stalberg.TMS.Data)
- using System;
- using System.Data;
- using System.Data.SqlClient;
- namespace Stalberg.TMS
- {
- //*******************************************************
- //
- // LocationDetails Class
- //
- // A simple data class that encapsulates details about a particular loc
- //
- //*******************************************************
- public partial class LocationDetails
- {
- public Int32 SZIntNo;
- public Int32 RdTIntNo;
- public Int32 ACIntNo;
- public string LocCameraCode;
- public string LocCode;
- public string LocStreetCode;
- public string LocStreetName;
- public string LocTravelDirection;
- public string LocDescr;
- public int LocOffenceSpeedStart;
- public string Province;
- public string City;
- public string Suburb;
- public string StreetA;
- public string StreetB;
- public string Route;
- public string From;
- public string To;
- public string GpsX;
- public string GpsY;
- public string LocBranchCode;
- public int LoSuIntNo;
- public string LocType;
- public string LocRegion;
- //2013-12-12 Heidi added IsRailwayCrossing for check Railway Crossing on Location Maintenance page(5149)
- public bool IsRailwayCrossing;
- }
- //*******************************************************
- //
- // LocationDB Class
- //
- // Business/Data Logic Class that encapsulates all data
- // logic necessary to add/login/query Locs within
- // the Commerce Starter Kit Customer database.
- //
- //*******************************************************
- public partial class LocationDB
- {
- string mConstr = "";
- public LocationDB(string vConstr)
- {
- mConstr = vConstr;
- }
- //*******************************************************
- //
- // LocDB.GetLocationDetails() Method <a name="GetLocationDetails"></a>
- //
- // The GetLocationDetails method returns a LocationDetails
- // struct that contains information about a specific
- // customer (name, password, etc).
- //
- //*******************************************************
- public LocationDetails GetLocationDetails(int locIntNo)
- {
- // Create Instance of Connection and Command Object
- SqlConnection con = new SqlConnection(mConstr);
- SqlCommand cmd = new SqlCommand("LocationDetail", con);
- // Mark the Command as a SPROC
- cmd.CommandType = CommandType.StoredProcedure;
- // Add Parameters to SPROC
- SqlParameter parameterLocIntNo = new SqlParameter("@LocIntNo", SqlDbType.Int, );
- parameterLocIntNo.Value = locIntNo;
- cmd.Parameters.Add(parameterLocIntNo);
- con.Open();
- SqlDataReader result = cmd.ExecuteReader(CommandBehavior.CloseConnection);
- // Create CustomerDetails Struct
- LocationDetails details = new LocationDetails();
- while (result.Read())
- {
- // Populate Struct using Output Params from SPROC
- details.ACIntNo = Convert.ToInt32(result["ACIntNo"]);
- details.RdTIntNo = Convert.ToInt32(result["RdTIntNo"]);
- details.SZIntNo = Convert.ToInt32(result["SZIntNo"]);
- details.LocOffenceSpeedStart = Convert.ToInt32(result["LocOffenceSpeedStart"]);
- details.LocCameraCode = result["LocCameraCode"].ToString();
- details.LocCode = result["LocCode"].ToString();
- details.LocDescr = result["LocDescr"].ToString();
- details.LocStreetCode = result["LocStreetCode"].ToString();
- details.LocStreetName = result["LocStreetName"].ToString();
- details.LocTravelDirection = result["LocTravelDirection"].ToString();
- details.Province = result["Province"].ToString();
- details.City = result["City"].ToString();
- details.Suburb = result["Suburb"].ToString();
- details.StreetA = result["StreetA"].ToString();
- details.StreetB = result["StreetB"].ToString();
- details.Route = result["Route"].ToString();
- details.From = result["From"].ToString();
- details.To = result["To"].ToString();
- details.GpsX = result["GpsX"].ToString();
- details.GpsY = result["GpsY"].ToString();
- details.LocBranchCode = result["LocBranchCode"].ToString();
- details.LoSuIntNo = Convert.ToInt32(result["LoSuIntNo"]);
- details.LocType = result["LocType"].ToString();
- details.LocRegion = result["LocRegion"].ToString();
- //2013-12-12 Heidi added for check Railway Crossing on Location Maintenance page(5149)
- details.IsRailwayCrossing = string.IsNullOrEmpty(result["IsRailwayCrossing"].ToString()) ? false : Convert.ToBoolean(result["IsRailwayCrossing"]);
- }
- result.Close();
- return details;
- }
- //*******************************************************
- //
- // LocDB.AddLoc() Method <a name="AddLoc"></a>
- //
- // The AddLoc method inserts a new loc record
- // into the locs database. A unique "LocId"
- // key is then returned from the method.
- //
- //*******************************************************
- public int AddLocation(int acIntNo, int szIntNo, int rdtIntNo,
- string locCameraCode, string locCode, string locDescr,
- string locStreetCode, string locStreetName, string locTravelDirection,
- int locOffenceSpeedStart, string province, string city, string suburb,
- string streetA, string streetB, string route, string from, string to, string gpsX, string gpsY,
- string locBranchCode, string lastUser, int LoSuIntNo, string locType, string locRegion, bool isRailwayCrossing)
- {
- // Create Instance of Connection and Command Object
- SqlConnection con = new SqlConnection(mConstr);
- SqlCommand cmd = new SqlCommand("LocationAdd", con);
- // Mark the Command as a SPROC
- cmd.CommandType = CommandType.StoredProcedure;
- // Add Parameters to SPROC
- SqlParameter parameterACIntNo = new SqlParameter("@ACIntNo", SqlDbType.Int, );
- parameterACIntNo.Value = acIntNo;
- cmd.Parameters.Add(parameterACIntNo);
- SqlParameter parameterRdTIntNo = new SqlParameter("@RdTIntNo", SqlDbType.Int, );
- parameterRdTIntNo.Value = rdtIntNo;
- cmd.Parameters.Add(parameterRdTIntNo);
- SqlParameter parameterSZIntNo = new SqlParameter("@SZIntNo", SqlDbType.Int, );
- parameterSZIntNo.Value = szIntNo;
- cmd.Parameters.Add(parameterSZIntNo);
- SqlParameter parameterLocCameraCode = new SqlParameter("@LocCameraCode", SqlDbType.VarChar, );
- parameterLocCameraCode.Value = locCameraCode;
- cmd.Parameters.Add(parameterLocCameraCode);
- SqlParameter parameterLocCode = new SqlParameter("@LocCode", SqlDbType.VarChar, );
- parameterLocCode.Value = locCode;
- cmd.Parameters.Add(parameterLocCode);
- SqlParameter parameterLocDescr = new SqlParameter("@LocDescr", SqlDbType.VarChar, );
- parameterLocDescr.Value = locDescr;
- cmd.Parameters.Add(parameterLocDescr);
- SqlParameter parameterLocStreetCode = new SqlParameter("@LocStreetCode", SqlDbType.VarChar, );
- parameterLocStreetCode.Value = locStreetCode;
- cmd.Parameters.Add(parameterLocStreetCode);
- SqlParameter parameterLocStreetName = new SqlParameter("@LocStreetName", SqlDbType.VarChar, );
- parameterLocStreetName.Value = locStreetName;
- cmd.Parameters.Add(parameterLocStreetName);
- SqlParameter parameterLocOffenceSpeedStart = new SqlParameter("@LocOffenceSpeedStart", SqlDbType.Int);
- parameterLocOffenceSpeedStart.Value = locOffenceSpeedStart;
- cmd.Parameters.Add(parameterLocOffenceSpeedStart);
- SqlParameter parameterLocTravelDirection = new SqlParameter("@LocTravelDirection", SqlDbType.Char, );
- parameterLocTravelDirection.Value = locTravelDirection;
- cmd.Parameters.Add(parameterLocTravelDirection);
- SqlParameter parameterLoSuIntNo = new SqlParameter("@LoSuIntNo", SqlDbType.Int, );
- parameterLoSuIntNo.Value = LoSuIntNo;
- cmd.Parameters.Add(parameterLoSuIntNo);
- cmd.Parameters.Add("Province", SqlDbType.VarChar, ).Value = province;
- cmd.Parameters.Add("City", SqlDbType.VarChar, ).Value = city;
- cmd.Parameters.Add("Suburb", SqlDbType.VarChar, ).Value = suburb;
- cmd.Parameters.Add("StreetA", SqlDbType.VarChar, ).Value = streetA;
- cmd.Parameters.Add("StreetB", SqlDbType.VarChar, ).Value = streetB;
- cmd.Parameters.Add("Route", SqlDbType.VarChar, ).Value = route;
- cmd.Parameters.Add("From", SqlDbType.VarChar, ).Value = from;
- cmd.Parameters.Add("To", SqlDbType.VarChar, ).Value = to;
- cmd.Parameters.Add("GpsX", SqlDbType.VarChar, ).Value = gpsX;
- cmd.Parameters.Add("GpsY", SqlDbType.VarChar, ).Value = gpsY;
- cmd.Parameters.Add("LocBranchCode", SqlDbType.Char, ).Value = locBranchCode;
- cmd.Parameters.Add("LastUser", SqlDbType.VarChar, ).Value = lastUser;
- cmd.Parameters.Add("LocType", SqlDbType.Char, ).Value = locType;
- cmd.Parameters.Add("LocRegion", SqlDbType.NVarChar, ).Value = locRegion;
- //2013-12-12 Heidi added for check Railway Crossing on Location Maintenance page(5149)
- cmd.Parameters.Add("IsRailwayCrossing", SqlDbType.Bit).Value = isRailwayCrossing;
- SqlParameter parameterLocIntNo = new SqlParameter("@LocIntNo", SqlDbType.Int, );
- parameterLocIntNo.Direction = ParameterDirection.Output;
- cmd.Parameters.Add(parameterLocIntNo);
- try
- {
- con.Open();
- cmd.ExecuteNonQuery();
- // Calculate the CustomerID using Output Param from SPROC
- int locIntNo = Convert.ToInt32(parameterLocIntNo.Value);
- return locIntNo;
- }
- catch (Exception e)
- {
- string msg = e.Message;
- return ;
- }
- finally
- {
- con.Dispose();
- }
- }
- public SqlDataReader GetLocationList(int autIntNo, string search, string orderBy)
- {
- // Create Instance of Connection and Command Object
- SqlConnection myConnection = new SqlConnection(mConstr);
- SqlCommand myCommand = new SqlCommand("LocationList", myConnection);
- // Mark the Command as a SPROC
- myCommand.CommandType = CommandType.StoredProcedure;
- SqlParameter parameterAutIntNo = new SqlParameter("@AutIntNo", SqlDbType.Int, );
- parameterAutIntNo.Value = autIntNo;
- myCommand.Parameters.Add(parameterAutIntNo);
- SqlParameter parameterSearch = new SqlParameter("@Search", SqlDbType.VarChar, );
- parameterSearch.Value = search;
- myCommand.Parameters.Add(parameterSearch);
- SqlParameter parameterOrderBy = new SqlParameter("@OrderBy", SqlDbType.VarChar, );
- parameterOrderBy.Value = orderBy;
- myCommand.Parameters.Add(parameterOrderBy);
- // Execute the command
- myConnection.Open();
- SqlDataReader result = myCommand.ExecuteReader(CommandBehavior.CloseConnection);
- // Return the datareader result
- return result;
- }
- public DataSet GetLocationListDS(int autIntNo, string search, string orderBy)
- {
- int totalCount;
- return GetLocationListDS(autIntNo, search, orderBy, out totalCount);
- }
- public DataSet GetLocationListDS(int autIntNo, string search, string orderBy, out int totalCount, int pageSize = , int pageIndex = )
- {
- SqlDataAdapter sqlDALocs = new SqlDataAdapter();
- DataSet dsLocs = new DataSet();
- // Create Instance of Connection and Command Object
- sqlDALocs.SelectCommand = new SqlCommand();
- sqlDALocs.SelectCommand.Connection = new SqlConnection(mConstr);
- sqlDALocs.SelectCommand.CommandText = "LocationList";
- // Mark the Command as a SPROC
- sqlDALocs.SelectCommand.CommandType = CommandType.StoredProcedure;
- SqlParameter parameterAutIntNo = new SqlParameter("@AutIntNo", SqlDbType.Int, );
- parameterAutIntNo.Value = autIntNo;
- sqlDALocs.SelectCommand.Parameters.Add(parameterAutIntNo);
- SqlParameter parameterSearch = new SqlParameter("@Search", SqlDbType.VarChar, );
- parameterSearch.Value = search;
- sqlDALocs.SelectCommand.Parameters.Add(parameterSearch);
- SqlParameter parameterOrderBy = new SqlParameter("@OrderBy", SqlDbType.VarChar, );
- parameterOrderBy.Value = orderBy;
- sqlDALocs.SelectCommand.Parameters.Add(parameterOrderBy);
- SqlParameter parameterPageSize = new SqlParameter("@PageSize", SqlDbType.Int);
- parameterPageSize.Value = pageSize;
- sqlDALocs.SelectCommand.Parameters.Add(parameterPageSize);
- SqlParameter parameterPageIndex = new SqlParameter("@PageIndex", SqlDbType.Int);
- parameterPageIndex.Value = pageIndex;
- sqlDALocs.SelectCommand.Parameters.Add(parameterPageIndex);
- SqlParameter parameterTotalCount = new SqlParameter("@TotalCount", SqlDbType.Int);
- parameterTotalCount.Direction = ParameterDirection.Output;
- sqlDALocs.SelectCommand.Parameters.Add(parameterTotalCount);
- // Execute the command and close the connection
- sqlDALocs.Fill(dsLocs);
- sqlDALocs.SelectCommand.Connection.Dispose();
- totalCount = (int)(parameterTotalCount.Value == DBNull.Value ? : parameterTotalCount.Value);
- // Return the dataset result
- return dsLocs;
- }
- public int UpdateLocation(int locIntNo, int acIntNo, int szIntNo, int rdtIntNo,
- string locCameraCode, string locCode, string locDescr,
- string locStreetCode, string locStreetName, string locTravelDirection,
- int locOffenceSpeedStart, string province, string city, string suburb,
- string streetA, string streetB, string route, string from, string to, string gpsX, string gpsY,
- string locBranchCode, string lastUser, int LoSuIntNo, string locType, string locRegion, bool isRailwayCrossing)
- {
- // Create Instance of Connection and Command Object
- SqlConnection con = new SqlConnection(mConstr);
- SqlCommand cmd = new SqlCommand("LocationUpdate", con);
- // Mark the Command as a SPROC
- cmd.CommandType = CommandType.StoredProcedure;
- // Add Parameters to SPROC
- SqlParameter parameterACIntNo = new SqlParameter("@ACIntNo", SqlDbType.Int, );
- parameterACIntNo.Value = acIntNo;
- cmd.Parameters.Add(parameterACIntNo);
- SqlParameter parameterRdTIntNo = new SqlParameter("@RdTIntNo", SqlDbType.Int, );
- parameterRdTIntNo.Value = rdtIntNo;
- cmd.Parameters.Add(parameterRdTIntNo);
- SqlParameter parameterSZIntNo = new SqlParameter("@SZIntNo", SqlDbType.Int, );
- parameterSZIntNo.Value = szIntNo;
- cmd.Parameters.Add(parameterSZIntNo);
- SqlParameter parameterLocCameraCode = new SqlParameter("@LocCameraCode", SqlDbType.VarChar, );
- parameterLocCameraCode.Value = locCameraCode;
- cmd.Parameters.Add(parameterLocCameraCode);
- SqlParameter parameterLocCode = new SqlParameter("@LocCode", SqlDbType.VarChar, );
- parameterLocCode.Value = locCode;
- cmd.Parameters.Add(parameterLocCode);
- SqlParameter parameterLocDescr = new SqlParameter("@LocDescr", SqlDbType.VarChar, );
- parameterLocDescr.Value = locDescr;
- cmd.Parameters.Add(parameterLocDescr);
- SqlParameter parameterLocStreetCode = new SqlParameter("@LocStreetCode", SqlDbType.VarChar, );
- parameterLocStreetCode.Value = locStreetCode;
- cmd.Parameters.Add(parameterLocStreetCode);
- SqlParameter parameterLocStreetName = new SqlParameter("@LocStreetName", SqlDbType.VarChar, );
- parameterLocStreetName.Value = locStreetName;
- cmd.Parameters.Add(parameterLocStreetName);
- SqlParameter parameterLocTravelDirection = new SqlParameter("@LocTravelDirection", SqlDbType.Char, );
- parameterLocTravelDirection.Value = locTravelDirection;
- cmd.Parameters.Add(parameterLocTravelDirection);
- SqlParameter parameterLocOffenceSpeedStart = new SqlParameter("@LocOffenceSpeedStart", SqlDbType.Int);
- parameterLocOffenceSpeedStart.Value = locOffenceSpeedStart;
- cmd.Parameters.Add(parameterLocOffenceSpeedStart);
- SqlParameter parameterLoSuIntNo = new SqlParameter("@LoSuIntNo", SqlDbType.Int, );
- parameterLoSuIntNo.Value = LoSuIntNo;
- cmd.Parameters.Add(parameterLoSuIntNo);
- cmd.Parameters.Add("Province", SqlDbType.VarChar, ).Value = province;
- cmd.Parameters.Add("City", SqlDbType.VarChar, ).Value = city;
- cmd.Parameters.Add("Suburb", SqlDbType.VarChar, ).Value = suburb;
- cmd.Parameters.Add("StreetA", SqlDbType.VarChar, ).Value = streetA;
- cmd.Parameters.Add("StreetB", SqlDbType.VarChar, ).Value = streetB;
- cmd.Parameters.Add("Route", SqlDbType.VarChar, ).Value = route;
- cmd.Parameters.Add("From", SqlDbType.VarChar, ).Value = from;
- cmd.Parameters.Add("To", SqlDbType.VarChar, ).Value = to;
- cmd.Parameters.Add("GpsX", SqlDbType.VarChar, ).Value = gpsX;
- cmd.Parameters.Add("GpsY", SqlDbType.VarChar, ).Value = gpsY;
- cmd.Parameters.Add("LocBranchCode", SqlDbType.Char, ).Value = locBranchCode;
- cmd.Parameters.Add("LastUser", SqlDbType.VarChar, ).Value = lastUser;
- cmd.Parameters.Add("LocType", SqlDbType.Char, ).Value = locType;
- cmd.Parameters.Add("LocRegion", SqlDbType.NVarChar, ).Value = locRegion;
- //2013-12-12 Heidi added for check Railway Crossing on Location Maintenance page(5149)
- cmd.Parameters.Add("IsRailwayCrossing", SqlDbType.Bit).Value = isRailwayCrossing;
- SqlParameter parameterLocIntNo = new SqlParameter("@LocIntNo", SqlDbType.Int);
- parameterLocIntNo.Direction = ParameterDirection.InputOutput;
- parameterLocIntNo.Value = locIntNo;
- cmd.Parameters.Add(parameterLocIntNo);
- try
- {
- con.Open();
- cmd.ExecuteNonQuery();
- con.Dispose();
- // Calculate the CustomerID using Output Param from SPROC
- int LocIntNo = (int)cmd.Parameters["@LocIntNo"].Value;
- //int locId = (int)parameterLocIntNo.Value;
- return LocIntNo;
- }
- catch (Exception e)
- {
- con.Dispose();
- string msg = e.Message;
- return ;
- }
- }
- public int DeleteLocation(int locIntNo, ref string errMessage)
- {
- // Create Instance of Connection and Command Object
- SqlConnection myConnection = new SqlConnection(mConstr);
- SqlCommand myCommand = new SqlCommand("LocationDelete", myConnection);
- // Mark the Command as a SPROC
- myCommand.CommandType = CommandType.StoredProcedure;
- // Add Parameters to SPROC
- SqlParameter parameterLocIntNo = new SqlParameter("@LocIntNo", SqlDbType.Int, );
- parameterLocIntNo.Value = locIntNo;
- parameterLocIntNo.Direction = ParameterDirection.InputOutput;
- myCommand.Parameters.Add(parameterLocIntNo);
- try
- {
- myConnection.Open();
- myCommand.ExecuteNonQuery();
- myConnection.Dispose();
- // Calculate the CustomerID using Output Param from SPROC
- int LocIntNo = (int)parameterLocIntNo.Value;
- return LocIntNo;
- }
- catch (Exception ex)
- {
- errMessage = ex.Message;
- return ;
- }
- finally
- {
- myConnection.Dispose();
- }
- }
- /// <summary>
- /// Gets the auth_Location list by auth DS.
- /// </summary>
- /// <param name="autIntNo">The aut int no.</param>
- /// <returns></returns>
- public DataSet GetValueTextListByLocationTable(int autIntNo)
- {
- SqlDataAdapter sqlDALocations = new SqlDataAdapter();
- DataSet dsLocations = new DataSet();
- // Create Instance of Connection and Command Object
- sqlDALocations.SelectCommand = new SqlCommand();
- sqlDALocations.SelectCommand.Connection = new SqlConnection(mConstr);
- sqlDALocations.SelectCommand.CommandText = "GetValueTextListByLocationTable";
- // Mark the Command as a SPROC
- sqlDALocations.SelectCommand.CommandType = CommandType.StoredProcedure;
- SqlParameter parameterAutIntNo = new SqlParameter("@AutIntNo", SqlDbType.Int, );
- parameterAutIntNo.Value = autIntNo;
- sqlDALocations.SelectCommand.Parameters.Add(parameterAutIntNo);
- // Execute the command and close the connection
- sqlDALocations.Fill(dsLocations);
- sqlDALocations.SelectCommand.Connection.Dispose();
- // Return the dataset result
- return dsLocations;
- }
- /// <summary>
- /// Heidi 2013-12-12 Get Railway Locations DDL by AutIntNo
- /// </summary>
- /// <param name="autIntNo">The aut int no.</param>
- /// <returns></returns>
- public DataSet GetRailwayLocationsByAutIntNo(int autIntNo,int locIntNo,bool IsAll)
- {
- SqlDataAdapter sqlDALocations = new SqlDataAdapter();
- DataSet dsLocations = new DataSet();
- // Create Instance of Connection and Command Object
- sqlDALocations.SelectCommand = new SqlCommand();
- sqlDALocations.SelectCommand.Connection = new SqlConnection(mConstr);
- sqlDALocations.SelectCommand.CommandText = "GetRailwayLocationsByAutIntNo";
- // Mark the Command as a SPROC
- sqlDALocations.SelectCommand.CommandType = CommandType.StoredProcedure;
- SqlParameter parameterAutIntNo = new SqlParameter("@AutIntNo", SqlDbType.Int, );
- parameterAutIntNo.Value = autIntNo;
- sqlDALocations.SelectCommand.Parameters.Add(parameterAutIntNo);
- SqlParameter parameterLocIntNo = new SqlParameter("@LocIntNo", SqlDbType.Int, );
- parameterLocIntNo.Value = locIntNo;
- sqlDALocations.SelectCommand.Parameters.Add(parameterLocIntNo);
- SqlParameter parameterISALL = new SqlParameter("@ISALL", SqlDbType.Bit);
- parameterISALL.Value = IsAll;
- sqlDALocations.SelectCommand.Parameters.Add(parameterISALL);
- // Execute the command and close the connection
- sqlDALocations.Fill(dsLocations);
- sqlDALocations.SelectCommand.Connection.Dispose();
- // Return the dataset result
- return dsLocations;
- }
- /// <summary>
- /// Heidi 2013-12-16 Get Railway Locations by AutIntNo and LocIntNo
- /// </summary>
- /// <param name="autIntNo">The aut int no.</param>
- /// <returns></returns>
- public DataSet GetLocationByLocIntNoAndIsRailwayCrossing(int autIntNo, int locIntNo)
- {
- SqlDataAdapter sqlDALocations = new SqlDataAdapter();
- DataSet dsLocations = new DataSet();
- // Create Instance of Connection and Command Object
- sqlDALocations.SelectCommand = new SqlCommand();
- sqlDALocations.SelectCommand.Connection = new SqlConnection(mConstr);
- sqlDALocations.SelectCommand.CommandText = "GetLocationByLocIntNoAndIsRailwayCrossing";
- // Mark the Command as a SPROC
- sqlDALocations.SelectCommand.CommandType = CommandType.StoredProcedure;
- SqlParameter parameterAutIntNo = new SqlParameter("@AutIntNo", SqlDbType.Int, );
- parameterAutIntNo.Value = autIntNo;
- sqlDALocations.SelectCommand.Parameters.Add(parameterAutIntNo);
- SqlParameter parameterLocIntNo= new SqlParameter("@LocIntNo", SqlDbType.Int, );
- parameterLocIntNo.Value = locIntNo;
- sqlDALocations.SelectCommand.Parameters.Add(parameterLocIntNo);
- // Execute the command and close the connection
- sqlDALocations.Fill(dsLocations);
- sqlDALocations.SelectCommand.Connection.Dispose();
- // Return the dataset result
- return dsLocations;
- }
- }
- }
从数据库中取数据(Stalberg.TMS.Data)的更多相关文章
- 定时从远程的数据库中取数据,然后把取出来的数据插入或更新本地的oracle数据库的表
最近项目中有一种需求: 大致需求是这样的 通过给定的 用户名和密码 要定时从远程的数据库中取数据,然后把取出来的数据插入或更新本地的oracle数据库的表 项目的结构式struts1 hibernat ...
- php从mysql数据库中取数据
php从数据库中取数据 面向过程 <?php $server_name="localhost:3306"; //数据库服务器名称 $username="root& ...
- loadrunner 参数化-如何从数据库中取数据-连接数据库进行参数化
LoadRunner提供两种参数化取值方式,一种是手动编辑,另一种就是通过连接数据库取值.一般在大型业务并发压力测试时,数据量肯定也都是非常大的,所以手动去编辑就不切实际了,这时用连接数据库的功能就方 ...
- JDBC:从数据库中取数据的一个bug
先看错误信息: java.sql.SQLException: Before start of result set at com.mysql.jdbc.SQLError.createSQLExcept ...
- mybatis从数据库中取数据且分组,返回分组数据
mapper.xml文件 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PU ...
- vb.net从数据库中取数据
1.设置从Model中的Sub Main 启动 2.程序结构 3.Model1 Imports System.Windows.Forms.Application Module Module1 Sub ...
- Jmeter-从数据库中获取数据并作为变量传输
再今天重新学习,从数据库中取数据,并作为变量传到下一个请求中. 首先第一步要导入mysql驱动包 一.添加JDBC Connection Configuration 设置链接 Database URL ...
- android从数据库中取音乐数据
android从手机数据库中取音乐数据 直接贴代码 public void getMp3(){ list = new ArrayList<>(); Cursor mAudioCursor ...
- 多线程查询数据,将结果存入到redis中,最后批量从redis中取数据批量插入数据库中【我】
多线程查询数据,将结果存入到redis中,最后批量从redis中取数据批量插入数据库中 package com.xxx.xx.reve.service; import java.util.ArrayL ...
随机推荐
- scw——03错误,swagger开启错误
错误: 代码: @Value("${swagger2.enable:false}") private boolean enable = false; 原因:没有开启swagger的 ...
- go基础_定时器
每间隔5s打印一句hello // time_ticker package main import ( "fmt" "time" ) func main() { ...
- C#常用的form窗体属性(最大化、最小化、窗体居中)
一.窗体居中 //窗体居中 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 二.去掉最小化.最大化 ...
- Linux - Linux中线程为何有PID?
重现 用htop的Tree view(按F5)之后查看线程 参考 https://segmentfault.com/q/1010000003586656 mousycoder的回答 https://u ...
- JS高级---复习
复习 面向过程和面向对象都是编程的思想, 方式不一样 面向过程: 凡事都是亲力亲为, 所有的代码都要自己写, 每一步都要很清楚, 注重的是过程 面向对象: 执行者成为指挥者, 只要找对象, 然后让对象 ...
- TCP的状态转换
TCP的状态转换图 手写的状态转换图 一.服务端状态变迁: 服务端创建套接字之后调用listen函数将套接字有一个未连接的主动套接字转换为被动套接字,指示内核应接受指向该套接字的连接请求,套接字状态 ...
- sublime3使用技巧
1.鼠标悬浮,显示文件引用 Preference ——> Settings ——> "index_files": true (保存,重新打开即可) 2 ...
- wampserver 配置的几个坑(雾
1. 从安装版本说起 自从我进入大学之后,便继承了学长那里的wampserver2.5版本 直到有一天自己下载wamp的时候才注意到已经有 3.0.6版本了 (现在有更高的了 但是3.0.6够用了) ...
- [NLP]Transformer模型解析
简介[2] Attention Is All You Need是2017年google提出来的一篇论文,论文里提出了一个新的模型,叫Transformer,这个结构广泛应用于NLP各大领域,是目前比较 ...
- Python 多任务(进程) day1(3)
进程间的通信 可以用socket进行进程间的通信 可以用同意文件来进行通信(但是在硬盘上读取和写入比较慢,内存运行太快了) Queue队列(记得是队列) 在同一内存中通信 因为进程之间不能共享全局变 ...