In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Maintain a record in the table DBCON that points to the HANA database. Enter the hostname and port number of the HANA database in the con_ENV. Such as vmXXXX:30015
DATA: ls_new TYPE DBCON.ls_new-con_name = 'HAN'.ls_new-dbms =' HDB'.ls_new-user_name = 'system'.ls_new-password =' Sap12345'.ls_new-con_env = 'vml2018:30015'.CALL FUNCTION' DBCON_INSERT' EXPORTING DBCON_WORKAREA = ls_new EXCEPTIONS DBCON_KEY_EXISTS = 1 SECURE_STORE_KEY_EXISTS = 2 SECURE _ STORE_OTHER = 3 OTHERS = 4. If SY-SUBRC = 0. WRITE:/ 'Insert Successfully'.ENDIF. Then use ABAP code to create a new table, insert three entry, and then read it. Finally, delete table.TYPES: BEGIN OF result_t, key TYPE i, value TYPE string, END OF result_t.DATA: connection TYPE dbcon-con_name VALUE 'HAN', stmt_ref TYPE REF TO cl_sql_statement, cx_sql_exception TYPE REF TO cx_sql_exception, lv_text TYPE string, res_ref TYPE REF TO cl_sql_result_set, d_ref TYPE REF TO DATA Result_tab TYPE TABLE OF result_t, result_line TYPE result_t, row_cnt TYPE I, con_ref TYPE REF TO cl_sql_connection.con_ref = cl_sql_connection= > get_connection (connection). Stmt_ref = con_ref- > create_statement (). TRY. Stmt_ref- > execute_ddl ('CREATE TABLE I042416_TESTPROC_TAB (key INT PRIMARY KEY, value NVARCHAR)'). Stmt_ref- > execute_update ('INSERT INTO I042416_TESTPROC_TAB VALUES (1,' First value'')'). Stmt_ref- > execute_update ('INSERT INTO I042416_TESTPROC_TAB VALUES (2,' Second value'')'). Stmt_ref- > execute_update ('INSERT INTO I042416_TESTPROC_TAB VALUES (3,' Third value'')'). Res_ref = stmt_ref- > execute_query ('SELECT * FROM I 042416 TESTPROCraft TAB'). GET REFERENCE OF result_tab INTO d_ref. Res_ref- > set_param_table (d_ref). Row_cnt = res_ref- > next_package (). Stmt_ref- > execute_ddl ('DROP TABLE I042416' TESTPROCraft TAB'). CATCH cx_sql_exception INTO cx_sql_exception. Lv_text = cx_sql_exception- > get_text (). WRITE:/ 'Error:', lv_text.ENDTRY.LOOP AT result_tab INTO result_line. The implementation of WRITE:/ 'Key:', result_line-key,' Value:', result_line-value.ENDLOOP. Java is similar: public static void main (String [] args) {try {Class.forName ("com.sap.db.jdbc.Driver"); System.out.println ("Create a connection...") Con = (com.sap.db.jdbc.trace.Connection) DriverManager .getConnection ("jdbc:sap://:30015", / /, "system", "enter login password here"); cs = (com.sap.db.jdbc.trace.CallableStatement) con.prepareCall ("call I042416_two_par (NULL, NULL)"); cs.execute () Int index = 0; do {int rowCount = 0; com.sap.db.jdbc.trace.ResultSet rs = (com.sap.db.jdbc.trace.ResultSet) cs.getResultSet (); ResultSetMetaData metaData = rs.getMetaData (); int columnCount = metaData.getColumnCount (); while (rs! = null & & rs.next ()) {for (int I = 1; I
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
-- oracle 11g--SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.