1. A programmable logic controller (PLC) for accessing a database system, the PLC comprising: a connection configured to connect the PLC with a personal computer for receiving a user program and definition information from the personal computer, wherein the definition information is in a non-SQL language; an interface configured to read values from an external sensor; a microprocessor configured to perform operations based on stored instructions; a memory configured to store the user program and the definition information, the user program including a variable of a structure type, the definition information indicating a definition of the structure type included in the user program; a converter configured to convert the definition information in the non-SQL language to a SQL statement for controlling the PLC to access the database system; and an executioner configured to execute the SQL statement that is generated by transmitting the SQL statement to the database system.