最近在做印度GST相关的东西,需要手动给系统实施上百个SAP Note,十分繁琐。

标准事务代码SNOTE只支持每次上传一个Note,逐个上传大量Note会很麻烦,为此摸索出一个批量解压上传的流程,下面是细节。

本文链接:https://www.cnblogs.com/hhelibeb/p/17548517.html

0,去SAP网站下载Note文件

1,准备好SAR文件,如 '0002407980_00.SAR',把所有SAR文件放到同一个目录下。

2,在相同目录内,放置SAPCAR.EXE解压程序。新建批处理程序xxx.bat,写入以下代码并运行:

@echo off
setlocal for %%f in (*.SAR) do (
SAPCAR -xvf "%%f"
) for %%f in (*.ZIP) do (
tar -xf "%%f"
) endlocal

这是ChatGPT提供的代码,可以解压当前目录下的SAR文件,具体功能解释如下,

  • @echo off 命令用于关闭命令的回显,使输出更清晰。
  • setlocalendlocal命令用于限制变量的范围,防止它们影响到其他的脚本和环境。
  • for %%f in (*.SAR) do这一行是一个for循环,它会遍历当前目录中所有的.SAR文件。每次迭代中,%%f变量都会包含一个文件名。
  • SAPCAR -xvf "%%f"这一行调用SAPCAR命令,并将当前文件名作为参数。%%f将被替换为实际的文件名。
  • 同理,下一个for遍历目录中所有的.ZIP文件并解压。

(注意,旧版windows可能不支持tar,但这并不要紧,只需要手动全选ZIP文件并解压即可。)

3,步骤2完成后,目录中出现解压得到的TXT文件,可以用于上传。

4,登陆你希望实施Note的SAP系统,运行程序 ZSCWN_NOTES_UPLOAD,选择上文中存放Note的目录,选择全部TXT文件,上传。

如果Note数量多的话,需要耐心等待一段时间,直到程序运行结束。之后,进入事务代码SNOTE,就可以看到批量上传的全部Note已经被加载到SNOTE中。

ZSCWN_NOTES_UPLOAD 的作者是Frank Buchholz,原文:Report ZSCWN_NOTES_UPLOAD – Load multiple notes files into SNOTE

为了防止链接失效,在下面贴出代码,

  1 *&---------------------------------------------------------------------*
2 *& Report ZSCWN_NOTES_UPLOAD
3 *& Load multiple notes files into SNOTE
4 *&---------------------------------------------------------------------*
5 *&
6 *& Reference:
7 *& Security Patch Process FAQ
8 *& http://scn.sap.com/community/security/blog/2012/03/27/security-patch-process-faq#23_What_should_I_do_if_I_cannot_download_a_note_into_SNOTE
9 *& 23. What should I do if I cannot download a note into SNOTE?
10 *&
11 *& Sometimes you run into trouble while downloading large notes in transaction SNOTE, like for the security note 1826162 from July 2013. (In addition this note requires another large note 1674132, too.)
12 *&
13 *& In such a case use the download basket to get the note:
14 *&
15 *& 1. Show the note on SMP, e.g. https://service.sap.com/sap/support/notes/1826162
16 *& 2. Use the button "Download Corrections". You get a new window showing a log.
17 *& 3. Repeat 1. and 2. for more notes, e.g. note 1826162 requires other note 1674132
18 *& 4. Use the button "Download Basket" on the log window to show your basket
19 *& 5. Click on every link for the selected notes to download the file via the internet browser (You could try to use the SAP Download Manager, however, this might not work as it uses the same interface like SNOTE.)
20 *& 6. Un-zip the archive files which you have downloaded
21 *& 7. In transaction SNOTE use the menu path Goto->Upload note to load the note(s) one by one
22 *& 8. Implement the note as usual
23 *&
24 *& Another advantage is, that you can use the same files for uploading notes into several development systems
25 *&
26 *& 19.08.2013 Initial version based on function SCWN_NOTE_UPLOAD_INTERNAL which allows the upload of a single file
27 *&
28 *&---------------------------------------------------------------------*
29
30 REPORT ZSCWN_NOTES_UPLOAD.
31
32 constants: c_program_version(15) type c value '19.08.2013'.
33
34 selection-screen begin of line.
35 selection-screen comment 1(32) T_PATH for field s_path.
36 parameters: s_path type string LOWER CASE.
37 selection-screen end of line.
38
39 SELECTION-SCREEN COMMENT 1(60) ss_vers.
40
41 *----------------------------------------------------------------------*
42
43 INITIALIZATION.
44 * Authorization check according to report SCWN_ENTRY_TREE (=SNOTE)
45 CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
46 EXPORTING
47 tcode = 'SNOTE'
48 EXCEPTIONS
49 ok = 0
50 not_ok = 1
51 OTHERS = 2.
52
53 IF sy-subrc <> 0.
54 * All messages raised from authority_check_tcode means:
55 * 'This transaction can or should not be started.'
56 MESSAGE i775(scwn) WITH 'SNOTE'.
57 LEAVE PROGRAM.
58 ENDIF.
59
60 T_PATH = 'Local path with text files'(000).
61
62 concatenate 'Program version from'(000) c_program_version into SS_VERS
63 SEPARATED BY SPACE.
64
65 * Get default download path
66 data l_UPLOAD_PATH type string.
67 CALL METHOD CL_GUI_FRONTEND_SERVICES=>GET_UPLOAD_DOWNLOAD_PATH
68 CHANGING
69 UPLOAD_PATH = l_UPLOAD_PATH
70 DOWNLOAD_PATH = s_path
71 EXCEPTIONS
72 CNTL_ERROR = 1
73 ERROR_NO_GUI = 2
74 NOT_SUPPORTED_BY_GUI = 3
75 GUI_UPLOAD_DOWNLOAD_PATH = 4
76 UPLOAD_DOWNLOAD_PATH_FAILED = 5
77 others = 6.
78 IF SY-SUBRC <> 0.
79 * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
80 * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
81 ENDIF.
82
83 *----------------------------------------------------------------------*
84
85 START-OF-SELECTION.
86
87 data: lv_file_filter TYPE string,
88 lv_filename TYPE string,
89 lv_file_table TYPE filetable,
90 lv_rc TYPE i,
91 lv_user_action TYPE i,
92 lv_file TYPE LINE OF filetable,
93 lv_title TYPE string.
94 data: lt_cont LIKE cwbdata OCCURS 0,
95 lv_FILELENGTH type i.
96
97 * dialog for file
98 CLASS cl_gui_frontend_services DEFINITION LOAD.
99 * Definition of file types see text elements of class CL_GUI_FRONTEND_SERVICES
100 lv_file_filter = cl_gui_frontend_services=>FILETYPE_TEXT.
101 lv_title = 'Upload SAP Note'(100).
102
103 * Ask for list of files
104 CALL METHOD cl_gui_frontend_services=>file_open_dialog
105 EXPORTING
106 window_title = lv_title
107 INITIAL_DIRECTORY = s_path
108 * default_filename = lv_filename
109 file_filter = lv_file_filter
110 multiselection = 'X'
111 CHANGING
112 file_table = lv_file_table
113 rc = lv_rc
114 user_action = lv_user_action
115 EXCEPTIONS
116 OTHERS = 1.
117
118 IF sy-subrc <> 0 OR lv_rc <= 0.
119 EXIT.
120 ENDIF.
121
122 IF lv_user_action = cl_gui_frontend_services=>action_cancel.
123 MESSAGE s020(scwn).
124 EXIT.
125 ENDIF.
126
127 * process files
128 data: lv_lines type i,
129 lv_percent type i,
130 lv_message(132).
131 describe table lv_file_table lines lv_lines.
132 loop at lv_file_table into lv_filename.
133
134 lv_percent = 100 * sy-tabix / lv_lines.
135 concatenate 'Read file'(002) lv_filename into lv_message SEPARATED BY space.
136 CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
137 EXPORTING
138 PERCENTAGE = lv_percent
139 TEXT = lv_message.
140
141 * Read file
142 CALL FUNCTION 'GUI_UPLOAD'
143 EXPORTING
144 filename = lv_filename
145 FILETYPE = 'ASC'
146 IMPORTING
147 FILELENGTH = lv_FILELENGTH
148 TABLES
149 data_tab = lt_cont
150 EXCEPTIONS
151 file_open_error = 1
152 file_read_error = 2
153 no_batch = 3
154 gui_refuse_filetransfer = 4
155 invalid_type = 5
156 no_authority = 6
157 unknown_error = 7
158 bad_data_format = 8
159 header_not_allowed = 9
160 separator_not_allowed = 10
161 header_too_long = 11
162 unknown_dp_error = 12
163 access_denied = 13
164 dp_out_of_memory = 14
165 disk_full = 15
166 dp_timeout = 16
167 OTHERS = 17.
168
169 IF sy-subrc <> 0.
170 MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
171 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
172 ENDIF.
173
174 * Process file
175 perform scwn_note_upload_internal
176 tables lt_cont.
177
178 endloop.
179
180 message 'Files loaded'(003) type 'S'.
181
182 *FUNCTION scwn_note_upload_internal.
183 *"----------------------------------------------------------------------
184 *"*"Lokale Schnittstelle:
185 *" EXCEPTIONS
186 *" INCOMPATIBLE_VERSIONS
187 *" CORRUPT_DATA_FILE
188 *"----------------------------------------------------------------------
189 constants: true type BCWBN_BOOL value 'X',
190 false type BCWBN_BOOL value space.
191 *
192 FORM scwn_note_upload_internal
193 tables lt_cont. " LIKE cwbdata OCCURS 0.
194
195 FIELD-SYMBOLS: <ls_cwbnthead> TYPE cwbnthead.
196
197 DATA: lv_cancel,
198 lv_filetype LIKE rlgrap-filetype,
199 * lt_cont LIKE cwbdata OCCURS 0,
200 lt_cwbnthead LIKE cwbnthead OCCURS 0,
201 lt_cwbntstxt LIKE cwbntstxt OCCURS 0,
202 lt_cwbntdata TYPE bcwbn_note_text OCCURS 0,
203 lt_cwbntvalid LIKE cwbntvalid OCCURS 0,
204 lt_cwbntci LIKE cwbntci OCCURS 0,
205 lt_cwbntfixed LIKE cwbntfixed OCCURS 0,
206 lt_cwbntgattr LIKE cwbntgattr OCCURS 0,
207 lt_cwbcihead LIKE cwbcihead OCCURS 0,
208 lt_cwbcidata TYPE bcwbn_cinst_delta OCCURS 0,
209 lt_cwbcivalid LIKE cwbcivalid OCCURS 0,
210 lt_cwbciinvld LIKE cwbciinvld OCCURS 0,
211 lt_cwbcifixed LIKE cwbcifixed OCCURS 0,
212 lt_cwbcidpndc LIKE cwbcidpndc OCCURS 0,
213 lt_cwbciobj LIKE cwbciobj OCCURS 0,
214 lt_cwbcmpnt LIKE cwbcmpnt OCCURS 0,
215 lt_cwbcmtext LIKE cwbcmtext OCCURS 0,
216 lt_cwbcmlast LIKE cwbcmlast OCCURS 0,
217 lt_cwbdehead LIKE cwbdehead OCCURS 0,
218 lt_cwbdeprdc LIKE cwbdeprdc OCCURS 0,
219 lt_cwbdetrack LIKE cwbdetrack OCCURS 0,
220 lt_cwbdeequiv LIKE cwbdeequiv OCCURS 0,
221 lt_cwbcidata_ref TYPE cwb_deltas,
222 * lv_file_filter TYPE string,
223 * lv_filename TYPE string,
224 * lv_file_table TYPE filetable,
225 * lv_rc TYPE i,
226 * lv_user_action TYPE i,
227 lv_file TYPE LINE OF filetable,
228 * lv_title TYPE string,
229 ls_note TYPE bcwbn_note,
230 lt_notes TYPE bcwbn_notes,
231 ls_cwbnthead LIKE cwbnthead.
232
233 DATA: lv_data_bin TYPE xstring,
234 lv_code_delta_bin TYPE xstring,
235 lt_object_data_bin TYPE cwbci_t_objdelta,
236 ls_numm_versno TYPE cwbntkeyvs.
237
238 ** dialog for file
239 * CLASS cl_gui_frontend_services DEFINITION LOAD.
240 * lv_file_filter = cl_gui_frontend_services=>filetype_all.
241 * lv_title = text-100.
242 *
243 * CALL METHOD cl_gui_frontend_services=>file_open_dialog
244 * EXPORTING
245 * window_title = lv_title
246 * default_filename = lv_filename
247 * file_filter = lv_file_filter
248 * CHANGING
249 * file_table = lv_file_table
250 * rc = lv_rc
251 * user_action = lv_user_action
252 * EXCEPTIONS
253 * OTHERS = 1.
254 *
255 * IF sy-subrc <> 0 OR lv_rc <= 0.
256 * EXIT.
257 * ENDIF.
258 *
259 * IF lv_user_action = cl_gui_frontend_services=>action_cancel.
260 * MESSAGE s020(scwn).
261 * EXIT.
262 * ENDIF.
263 *
264 ** upload file
265 * READ TABLE lv_file_table INTO lv_file INDEX 1.
266 * lv_filename = lv_file-filename.
267 *
268 * CALL FUNCTION 'GUI_UPLOAD'
269 * EXPORTING
270 * filename = lv_filename
271 * TABLES
272 * data_tab = lt_cont_bin
273 * EXCEPTIONS
274 * file_open_error = 1
275 * file_read_error = 2
276 * no_batch = 3
277 * gui_refuse_filetransfer = 4
278 * invalid_type = 5
279 * no_authority = 6
280 * unknown_error = 7
281 * bad_data_format = 8
282 * header_not_allowed = 9
283 * separator_not_allowed = 10
284 * header_too_long = 11
285 * unknown_dp_error = 12
286 * access_denied = 13
287 * dp_out_of_memory = 14
288 * disk_full = 15
289 * dp_timeout = 16
290 * OTHERS = 17.
291 *
292 * IF sy-subrc <> 0.
293 * MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
294 * WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
295 * ENDIF.
296
297 CALL FUNCTION 'SCWN_NOTE_UNPACK'
298 IMPORTING
299 ev_data_bin = lv_data_bin
300 ev_code_delta_bin = lv_code_delta_bin
301 et_object_data_bin = lt_object_data_bin
302 TABLES
303 tt_cont = lt_cont
304 EXCEPTIONS
305 incompatible_versions = 1
306 corrupt_data_file = 2
307 OTHERS = 3.
308
309 IF sy-subrc <> 0.
310 MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
311 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
312 ENDIF.
313
314 CALL FUNCTION 'SCWN_NOTE_UNPACK_XML'
315 EXPORTING
316 iv_data_bin = lv_data_bin
317 iv_code_delta_bin = lv_code_delta_bin
318 it_object_data_bin = lt_object_data_bin
319 IMPORTING
320 et_cwbnthead = lt_cwbnthead
321 et_cwbntstxt = lt_cwbntstxt
322 et_cwbntdata = lt_cwbntdata
323 et_cwbntvalid = lt_cwbntvalid
324 et_cwbntci = lt_cwbntci
325 et_cwbntfixed = lt_cwbntfixed
326 et_cwbntgattr = lt_cwbntgattr
327 et_cwbcihead = lt_cwbcihead
328 et_cwbcidata = lt_cwbcidata
329 et_cwbcidata_ref = lt_cwbcidata_ref
330 et_cwbcivalid = lt_cwbcivalid
331 et_cwbciinvld = lt_cwbciinvld
332 et_cwbcifixed = lt_cwbcifixed
333 et_cwbcidpndc = lt_cwbcidpndc
334 et_cwbciobj = lt_cwbciobj
335 et_cwbcmpnt = lt_cwbcmpnt
336 et_cwbcmtext = lt_cwbcmtext
337 et_cwbcmlast = lt_cwbcmlast
338 et_cwbdehead = lt_cwbdehead
339 et_cwbdeprdc = lt_cwbdeprdc
340 et_cwbdetrack = lt_cwbdetrack
341 et_cwbdeequiv = lt_cwbdeequiv
342 EXCEPTIONS
343 corrupt_data_file = 1
344 incompatible_versions = 2
345 OTHERS = 3.
346 IF sy-subrc <> 0.
347 MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
348 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
349 RAISING corrupt_data_file.
350 ENDIF.
351
352 * store note
353 CALL FUNCTION 'SCWN_NOTE_STORE'
354 EXPORTING
355 it_cwbcmpnt = lt_cwbcmpnt
356 it_cwbdetrack = lt_cwbdetrack
357 it_cwbdehead = lt_cwbdehead
358 it_cwbdeequiv = lt_cwbdeequiv
359 TABLES
360 tt_cwbnthead = lt_cwbnthead
361 tt_cwbntstxt = lt_cwbntstxt
362 tt_cwbntdata = lt_cwbntdata
363 tt_cwbntvalid = lt_cwbntvalid
364 tt_cwbntci = lt_cwbntci
365 tt_cwbntfixed = lt_cwbntfixed
366 tt_cwbntgattr = lt_cwbntgattr
367 tt_cwbcihead = lt_cwbcihead
368 tt_cwbcidata = lt_cwbcidata
369 tt_cwbcidata_ref = lt_cwbcidata_ref
370 tt_cwbcivalid = lt_cwbcivalid
371 tt_cwbciinvld = lt_cwbciinvld
372 tt_cwbcifixed = lt_cwbcifixed
373 tt_cwbcidpndc = lt_cwbcidpndc
374 tt_cwbciobj = lt_cwbciobj
375 EXCEPTIONS
376 failure = 1
377 OTHERS = 2.
378
379 IF sy-subrc <> 0.
380 MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
381 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
382 ELSE.
383 * store each stored note in download history
384 LOOP AT lt_cwbnthead ASSIGNING <ls_cwbnthead>.
385 ls_numm_versno-numm = <ls_cwbnthead>-numm.
386 ls_numm_versno-versno = <ls_cwbnthead>-versno.
387 CALL FUNCTION 'SCWN_NOTE_DOWNLOAD_HIST'
388 EXPORTING
389 is_note_version = ls_numm_versno
390 iv_mode_write = true
391 EXCEPTIONS
392 OTHERS = 1.
393 IF sy-subrc <> 0.
394 MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
395 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
396 ENDIF.
397 ENDLOOP.
398 ENDIF.
399
400 * update software component if necessary
401 CALL FUNCTION 'SCWN_UPDATE_SOFTWARE_COMPONENT'
402 TABLES
403 tt_cwbcmpnt = lt_cwbcmpnt
404 tt_cwbcmtext = lt_cwbcmtext
405 tt_cwbcmlast = lt_cwbcmlast
406 tt_cwbdehead = lt_cwbdehead
407 tt_cwbdeprdc = lt_cwbdeprdc
408 tt_cwbdetrack = lt_cwbdetrack
409 tt_cwbdeequiv = lt_cwbdeequiv
410 EXCEPTIONS
411 failure = 1
412 OTHERS = 2.
413
414 IF sy-subrc <> 0.
415 MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
416 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
417 ENDIF.
418
419 * classify notes
420 LOOP AT lt_cwbnthead INTO ls_cwbnthead.
421 ls_note-key-numm = ls_cwbnthead-numm.
422 ls_note-key-versno = ls_cwbnthead-versno.
423 APPEND ls_note TO lt_notes.
424 ENDLOOP.
425
426 CALL FUNCTION 'SCWB_NOTES_CLASSIFY'
427 EXPORTING
428 it_notes = lt_notes
429 iv_set_ntstatus = ' '.
430
431 ENDFORM.
432 *ENDFUNCTION.

ZSCWN_NOTES_UPLOAD

批量解压上传SAP Note的更多相关文章

  1. PHP自动解压上传的rar文件

    PHP自动解压上传的rar文件   浏览:383 发布日期:2015/07/20 分类:功能实现 关键字: php函数 php扩展 大家都知道php有个zip类可直接操作zip压缩文件,可是用户有时候 ...

  2. 解压上传的zip文件流和文件

    /** * 解压上传的zip文件流 * @param stream * @param outputDirectory */ public static String unzip(InputStream ...

  3. Java解压上传zip或rar文件,并解压遍历文件中的html的路径

    1.本文只提供了一个功能的代码 public String addFreeMarker() throws Exception { HttpSession session = request.getSe ...

  4. Flask保存或解压上传的文件

    import os import uuid import shutil import zipfile from flask import Flask, render_template, request ...

  5. 工作随笔——tar命令批量解压

    由于linux的tar命令不支持批量解压,所以很多网友编写了好多支持批量解压的shell命令,收集了一下,供大家分享: 第一: for tar in *.tar.gz; do tar xvf $tar ...

  6. Linux命令:tar命令批量解压方法总结

    tar命令批量解压方法总结 (2010-05-24 17:48:46) 转载▼ 标签: tar 批量解压 杂谈 分类: linux学习 由于linux的tar命令不支持批量解压,所以很多网友编写了好多 ...

  7. 特定条件下批量解压文件改变编码,顺便修改.so.0找不到等一些小问题

    直接结论: 1.linux解压文件乱码: unzip -O GBK *.zip 2.linux改变文件内容编码: 安装enca,下载地址:https://github.com/nijel/enca/i ...

  8. Linux批量解压文件

    最近下载了Imagenet2012的数据文件,训练数据下有很多tar文件,这些tar文件都在一个目录内,所以想批量解压到该目录下每个单独的文件夹内 批量解压的步骤是, 1.列出所有的以tar为后缀的文 ...

  9. Java实现FTP批量大文件上传下载篇1

    本文介绍了在Java中,如何使用Java现有的可用的库来编写FTP客户端代码,并开发成Applet控件,做成基于Web的批量.大文件的上传下载控件.文章在比较了一系列FTP客户库的基础上,就其中一个比 ...

  10. java批量解压文件夹下的所有压缩文件(.rar、.zip、.gz、.tar.gz)

    // java批量解压文件夹下的所有压缩文件(.rar..zip..gz..tar.gz) 新建工具类: package com.mobile.utils; import com.github.jun ...

随机推荐

  1. verilog之原语设计

    verilog之原语设计 1.原语作用 在一般的verilog设计中,一般采用数字逻辑设计,由软件将数字逻辑转化为特定的数字电路.但是,对于某些特殊的领域,有可能需要用户直接自定义数字电路以达到对指定 ...

  2. KingbaseES 名词解释之timeline

    timeline定义 每当归档文件恢复完成后,创建一个新的时间线用来区别新生成的WAL记录.WAL文件名由时间线和日志序号组成 引入timeline的意义 为了理解引入时间线的背景,我们来分析一下,如 ...

  3. KingbaseES V8R3 集群运维案例--kingbase_monitor.sh启动”two master“案例

    案例说明: KingbaseES V8R3集群,执行kingbase_monitor.sh启动集群,出现"two master"节点的故障,启动集群失败:通过手工sys_ctl启动 ...

  4. C++设计模式 - 观察者模式(Observer)

    组件协作模式: 现代软件专业分工之后的第一个结果是"框架与应用程序的划分","组件协作"模式通过晚期绑定,来实现框架与应用程序之间的松耦合,是二者之间协作时常用 ...

  5. Ubuntu20.04 LTS国内源安装指定版本Docker/docker-compose

    1.卸载旧版本Docker #卸载旧版本docker sudo apt-get remove docker docker-engine docker-ce docker.io #清空旧版docker占 ...

  6. 测试开发之网络篇-OSI七层协议

    今天,我们来了解一下OSI(Open System Interconnect)开放式系统互连.它是ISO组织在1985年发布的网络互连模型,该标准定义了网络互连的七层框架.其内容简述如下: 我们办公室 ...

  7. JDK9的新特性:String压缩和字符编码

    目录 简介 底层实现 总结 简介 String的底层存储是什么?相信大部分人都会说是数组.如果要是再问一句,那么是以什么数组来存储呢?相信不同的人有不同的答案. 在JDK9之前,String的底层存储 ...

  8. 这一次,让我们一起来搞懂MySQL

    欢迎加入我的专栏,和我一起开始 MySQL 学习之旅. 从日常的开发和优化中,一步步地从一个数据库小白成为 MySQL 调优的开发人员.回想起来,从我第一次带创建索引至今,已经有十个年头了.在这个过程 ...

  9. Java 枚举(Enums)解析:提高代码可读性与易维护性

    接口 在 Java 中,实现抽象的另一种方式是使用接口. 接口定义 接口是一个完全抽象的类,用于将具有空方法体的相关方法分组: // 接口 interface Animal { public void ...

  10. C# 循环与条件语句详解

    C# Switch 语句 使用 switch 语句选择要执行的多个代码块中的一个. 示例: switch(expression) { case x: // 代码块 break; case y: // ...