```java String url = "jdbc:oracle:thin:@localhost:1521:xe"; String user = "scott"; String password = "tiger"; Connection conn = DriverManager.getConnection(url, user, password); ``` ```java String sql = "SELECT * FROM student WHERE age > 18"; Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(sql); while (rs.next()) { String name = rs.getString("name"); int age = rs.getInt("age"); System.out.println("Name: " + name + ", Age: " + age); } ``` ```sql CREATE OR REPLACE PROCEDURE add_two_numbers( num1 IN NUMBER, num2 IN NUMBER, result OUT NUMBER ) AS BEGIN result := num1 + num2; END; ``` ```java String sql = "{call add_two_numbers(?, ?, ?)}"; CallableStatement cstmt = conn.prepareCall(sql); cstmt.setInt(1, 10); cstmt.setInt(2, 20); cstmt.registerOutParameter(3, Types.NUMERIC); cstmt.execute(); int result = cstmt.getInt(3); System.out.println("Result: " + result); ```
``` log_archive_dest_1='LOCATION=/archivelog' log_archive_format='%t_%s_%r.arc' remote_login_passwordfile='EXCLUSIVE' ``` ``` standby_file_management='AUTO' fal_server='primary_host' fal_client='standby_host' db_file_name_convert='/primary/','/standby/' ``` ``` rac_node1 rac_node2 rac_node3 ``` ``` $ ./runcluvfy.sh stage –pre crsinst -n `cat rac_nodes.txt` -verbose $ ./runInstaller -silent -responseFile /opt/database/response/db_install.rsp $ ./root.sh $ ./dbca -silent -createDatabase -templateName /opt/database/templates/general.dbc -gdbname orcl -sid orcl -responseFile /opt/database/response/dbca.rsp -dbsnmpPassword password1 ```
```python pip install unoconv ``` ```python import unoconv def convert_file(input_file, output_file): unoconv.convert(input_file, output_file) input_file = 'input.docx' output_file = 'output.pdf' convert_file(input_file, output_file) ``` ```shell export UNO_PATH=/usr/lib/libreoffice export UNO_PORT=2002 ```
```python import subprocess def convert_to_pdf(input_file, output_file): command = ['unoconv', '-f', 'pdf', '-o', output_file, input_file] process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = process.communicate() if stderr: print(f"Conversion failed: {stderr.decode()}") else: print("Conversion successful") input_file = 'input.docx' output_file = 'output.pdf' convert_to_pdf(input_file, output_file) ```