Apache James配置连接达梦数据库

news2024/11/15 15:51:39

项目场景:

Apache James配置连接达梦数据库,其他配置中不存在的数据库也可参考此方案。


配置步骤

1、把需要的jar包导入到James

把DmJdbcDriver18.jar复制到下面lib目录下

james-2.3.2\lib

2、 修改连接配置

james-2.3.2\apps\james\SAR-INF\config.xml

<users-store>
	<repository name="LocalUsers" class="org.apache.james.userrepository.JamesUsersJdbcRepository" destinationURL="db://maildb/mail_users">
		<sqlFile>file://conf/sqlResources.xml</sqlFile>
	</repository>
</users-store>

<database-connections>
	<data-source name="maildb" class="org.apache.james.util.dbcp.JdbcDataSource">
		<driver>dm.jdbc.driver.DmDriver</driver>
		<dburl>jdbc:dm://172.0.0.1:5236/test</dburl>
		<user>test</user>
		<password>test_200</password>
		<max>50</max>
	</data-source>
</database-connections>

3、 修改sql语句

james-2.3.2\apps\james\conf\sqlResources.xml

<!-- 
 Licensed to the Apache Software Foundation (ASF) under one   
 or more contributor license agreements.  See the NOTICE file 
 distributed with this work for additional information        
 regarding copyright ownership.  The ASF licenses this file   
 to you under the Apache License, Version 2.0 (the            
 "License"); you may not use this file except in compliance   
 with the License.  You may obtain a copy of the License at   
                                                               
   http://www.apache.org/licenses/LICENSE-2.0                 
                                                               
  Unless required by applicable law or agreed to in writing,   
 software distributed under the License is distributed on an  
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       
 KIND, either express or implied.  See the License for the    
 specific language governing permissions and limitations      
 under the License.  
-->
<!--
  Licensed to the Apache Software Foundation (ASF) under one   
  or more contributor license agreements.  See the NOTICE file 
  distributed with this work for additional information        
  regarding copyright ownership.  The ASF licenses this file   
  to you under the Apache License, Version 2.0 (the            
  "License"); you may not use this file except in compliance   
  with the License.  You may obtain a copy of the License at   
                                                               
    http://www.apache.org/licenses/LICENSE-2.0                 
                                                               
  Unless required by applicable law or agreed to in writing,   
  software distributed under the License is distributed on an  
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       
  KIND, either express or implied.  See the License for the    
  specific language governing permissions and limitations      
  under the License.                                           
 -->
<!-- SQL Statements used by James for database access. -->
<sqlResources>

<!--
     This section provided configuration to determine the determine the
     database product which is being used for storage. Different database
     products may require different SQL syntax.

     The jdbc database connection is examined to see if it matches with the
     regular expressions specified in any of the defined matchers. The matchers
     are processed in the over provided here, with the first successful match
     defining the "db" value for this connection.

     This value is then used to choose between different definitions for various
     named sql statements, defined below. If no match is found,
     the default sql statements are used.
-->
<dbMatchers>
    <dbMatcher db="mssql" databaseProductName="microsoft sql server"/>
    <dbMatcher db="oracle" databaseProductName="oracle.*"/>
	<dbMatcher db="dm" databaseProductName="dm.*"/>
    <dbMatcher db="mysql" databaseProductName="my.*"/>
    <dbMatcher db="derby" databaseProductName="derby.*"/>
    <dbMatcher db="postgresql" databaseProductName="postgres.*"/>
    <dbMatcher db="hsqldb" databaseProductName="hsql.*"/>
    <dbMatcher db="sapdb" databaseProductName="sap.*"/>
    <dbMatcher db="hypersonic" databaseProductName="HypersonicSQL"/>
    <dbMatcher db="db2" databaseProductName="db2.*"/>
    <dbMatcher db="ingres" databaseProductName="ingres.*"/>
</dbMatchers>

<!--
    With the following section it is possible to associate several name/value pairs
        of options to a database product, identified by the "db" XML attribute name.
    
    An element without a "db" attribute, if used for an option name, will become a default value for such option.
    Each option may have a "default default", i.e. a default that applies if no element with an empty
        "db" attribute (default element) exists as said above;
        such default default must be documented for such option below.
    
    The order of the XML elements is meaningless.
    
    Here only "getBody" and "getAttributes" option names are set, but others could be used in the future.
    Option names:
        "getBody" - a string (case insensitive) telling which JDBC ResultSet method will be used to
            get the message body field for a database product.
            The default default value is "useBytes"..
            Values (case insensitive):
                "useBytes"  - use getBytes(int).
                "useBlob"   - use getBlob(int).
        "getAttributes" - a string (case insensitive) telling which JDBC ResultSet method will be used to
            get the message attributes field for a database product.
           The default default value is "useBytes"..
            Values (case insensitive):
                "useBytes"  - use getBytes(int).
                "useBlob"   - use getBlob(int).
-->
<dbOptions>
    <dbOption name="getBody" value="useBytes"/>
    <dbOption name="getAttributes" value="useBytes"/>
    <dbOption db="mssql" name="getBody" value="useBytes"/>
    <dbOption db="mssql" name="getAttributes" value="useBytes"/>
    <dbOption db="oracle" name="getBody" value="useBlob"/>
    <dbOption db="oracle" name="getAttributes" value="useBlob"/>
	<dbOption db="dm" name="getBody" value="useBlob"/>
    <dbOption db="dm" name="getAttributes" value="useBlob"/>
    <dbOption db="mysql" name="getBody" value="useBytes"/>
    <dbOption db="mysql" name="getAttributes" value="useBytes"/>
    <dbOption db="derby" name="getBody" value="useBytes"/>
    <dbOption db="derby" name="getAttributes" value="useBytes"/>
    <dbOption db="postgresql" name="getBody" value="useBytes"/>
    <dbOption db="postgresql" name="getAttributes" value="useBytes"/>
    <dbOption db="sapdb" name="getBody" value="useBytes"/>
    <dbOption db="sapdb" name="getAttributes" value="useBytes"/>
    <dbOption db="hypersonic" name="getBody" value="useBytes"/>
    <dbOption db="hypersonic" name="getAttributes" value="useBytes"/>
    <dbOption db="hsqldb" name="getBody" value="useBytes"/>
    <dbOption db="hsqldb" name="getAttributes" value="useBytes"/>
    <dbOption db="db2" name="getBody" value="useBlob"/>
    <dbOption db="db2" name="getAttributes" value="useBlob"/>
    <dbOption db="ingres" name="getBody" value="useBytes"/>
    <dbOption db="ingres" name="getAttributes" value="useBytes"/>
</dbOptions>

<!-- SQL statements to use for various components. -->
<!-- -->
<!-- Parameter definitions ${param} are replaced with parameter values -->
<!-- read from the configuration file. -->
<!-- -->
<!-- If a named statement has a definition defined for the current database product, -->
<!-- then that statement is used. Otherwise the default statement is used. -->

<!-- SQL statements for the JamesUsersJdbcRepository -->
<!-- -->
<!-- The JamesUsersJdbcRepository allows James to use a JDBC compliant database -->
<!-- to hold user related data.  This includes aliases, forward addresses, -->
<!-- and password data.  The last is stored as an irreversible hash. -->
<sqlDefs name="org.apache.james.userrepository.JamesUsersJdbcRepository">
    <sql name="tableName">${table}</sql>

    <!-- Statements used to retrieve all user information for a user from this repository. -->
    <sql name="select">SELECT username, pwdHash, pwdAlgorithm, useForwarding,
                        forwardDestination, useAlias, alias
                 FROM ${table}
                 ORDER BY username
    </sql>

    <!-- Statements used to get all user information for a user with a particular user name in a -->
    <!-- case-insensitive fashion from this repository. -->
    <sql name="selectByLowercaseName">
                SELECT username, pwdHash, pwdAlgorithm, useForwarding,
                        forwardDestination, useAlias, alias
                FROM ${table}
                WHERE lower(username) = ?
    </sql>

    <sql name="selectByLowercaseName" db="mysql">
                SELECT username, pwdHash, pwdAlgorithm, useForwarding,
                        forwardDestination, useAlias, alias
                FROM ${table}
                WHERE username = ?
    </sql>

    <!-- Statements used to insert a user into this repository. -->
    <sql name="insert">INSERT INTO ${table}
                    (username, pwdHash, pwdAlgorithm, useForwarding, forwardDestination, useAlias, alias)
                VALUES (?,?,?,?,?,?,?)
    </sql>

    <!-- Statements used to update information for a user from this repository. -->
    <sql name="update">UPDATE ${table} SET
                    pwdHash = ?, pwdAlgorithm = ?, useForwarding = ?, forwardDestination = ?, useAlias = ?, alias = ?
                WHERE username = ?
    </sql>

    <!-- Statements used to delete a user from this repository. -->
    <sql name="delete">DELETE FROM ${table} WHERE username = ?</sql>

    <!-- Statements used to create the table associated with this class. -->
    <sql name="createTable" db="hypersonic">CREATE CACHED TABLE ${table} (username VARCHAR(64) NOT NULL, pwdHash VARCHAR(50), pwdAlgorithm VARCHAR(20), useForwarding INTEGER, forwardDestination VARCHAR(255), useAlias INTEGER, alias VARCHAR(255), PRIMARY KEY(username))</sql>
    <!-- <sql name="createTable">CREATE TABLE ${table} (username VARCHAR(64) NOT NULL, pwdHash VARCHAR(50), pwdAlgorithm VARCHAR(20), useForwarding SMALLINT, forwardDestination VARCHAR(255), useAlias SMALLINT, alias VARCHAR(255), PRIMARY KEY(username))</sql> -->
    <sql name="createTable">select 1 from dual</sql>
	<!-- An example of a database-specific sql statement
    <sql name="createTable" db="mssql">CREATE TABLE ${table} (uniqueId UNIQUEIDENTIFIER, username VARCHAR(64) NOT NULL, pwdHash VARCHAR(50), pwdAlgorithm VARCHAR(20), useForwarding SMALLINT, forwardDestination VARCHAR(255), useAlias SMALLINT, alias VARCHAR(255), PRIMARY KEY(username))</sql>
    -->
</sqlDefs>

<!-- SQL statements for the DefaultUsersJdbcRepository -->
<!-- -->
<!-- The DefaultUsersJdbcRepository allows James to use a JDBC compliant database -->
<!-- to hold user ids and password data. The password is stored as an irreversible hash. -->
<!-- Unlike the JamesUsersJdbcRepository, this repository implementation doesn't support -->
<!-- aliases or forwards. -->
<sqlDefs name="org.apache.james.userrepository.DefaultUsersJdbcRepository">
    <sql name="tableName">${table}</sql>

    <!-- Statements used to retrieve all user information for a user from this repository. -->
    <sql name="select">SELECT username, pwdHash, pwdAlgorithm
                 FROM ${table}
    </sql>

    <!-- Statements used to insert a user into this repository. -->
    <sql name="insert">INSERT INTO ${table}
                    (username, pwdHash, pwdAlgorithm)
                VALUES (?,?,?)
    </sql>

    <!-- Statements used to update information for a user from this repository. -->
    <sql name="update">UPDATE ${table} SET
                    pwdHash = ?, pwdAlgorithm = ?
                WHERE username = ?
    </sql>

    <!-- Statements used to delete a user from this repository. -->
    <sql name="delete">DELETE FROM ${table} WHERE username = ?</sql>

    <!-- Statements used to create the table associated with this class. -->
    <sql name="createTable" db="hypersonic">CREATE CACHED TABLE ${table} (username VARCHAR(64) NOT NULL, pwdHash VARCHAR(50), pwdAlgorithm VARCHAR(20), PRIMARY KEY(username))</sql>
    <sql name="createTable">CREATE TABLE ${table} (username VARCHAR(64) NOT NULL, pwdHash VARCHAR(50), pwdAlgorithm VARCHAR(20), PRIMARY KEY(username))</sql>
</sqlDefs>

<!-- SQL statements for the ListUsersJdbcRepository -->
<!-- -->
<!-- This class is used for basic list management.  The database table can -->
<!-- be used to store subscriber data for mulitple lists.  -->
<sqlDefs name="org.apache.james.userrepository.ListUsersJdbcRepository">
    <!-- An example of defining "default" parameters within the definition file.
         This is used if no key parameter is specified in config. -->
    <parameters key="unknownList"/>

    <sql name="tableName">${table}</sql>

    <!-- Statements used to retrieve all users on a particular list from this repository. -->
    <sql name="select">SELECT listSubscriber
                 FROM ${table}
                 WHERE listName = '${key}'
    </sql>

    <!-- Statements used to insert a user/list mapping into this repository. -->
    <sql name="insert">INSERT INTO ${table}
                    (listSubscriber, listName)
                VALUES (?, '${key}')
    </sql>

    <!-- Statements used to update a user/list mapping in this repository. -->
    <sql name="update">UPDATE ${table} SET
                    listSubscriber = ?
                WHERE listSubscriber = ? AND listName = '${key}'
    </sql>

    <!-- Statements used to delete a user/list mapping from this repository. -->
    <sql name="delete">DELETE FROM ${table}
                WHERE listSubscriber = ? AND listName = '${key}'
    </sql>

    <!-- Statements used to create the table associated with this class. -->
    <sql name="createTable" db="hypersonic">CREATE CACHED TABLE ${table} (listName VARCHAR(64) NOT NULL, listSubscriber VARCHAR(255) NOT NULL, PRIMARY KEY(listName, listSubscriber))</sql>
    <sql name="createTable">CREATE TABLE ${table} (listName VARCHAR(64) NOT NULL, listSubscriber VARCHAR(255) NOT NULL, PRIMARY KEY(listName, listSubscriber))</sql>
</sqlDefs>

<!-- SQL statements for the JdbcMailRepository  -->
<sqlDefs name="org.apache.james.mailrepository.JDBCMailRepository">

    <!-- Statements used to check whether a particular message exists in this repository. -->
    <sql name="checkMessageExistsSQL">SELECT count(*) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>

    <!-- Statements used to update a message stored in this repository. -->
    <sql name="updateMessageSQL">UPDATE ${table} SET message_state = ?, error_message = ?, sender = ?, recipients = ?, remote_host = ?, remote_addr = ?, last_updated = ? WHERE message_name = ? AND repository_name = ?</sql>

    <!-- Statements used to update the body of a message stored in this repository. -->
    <sql name="updateMessageBodySQL">UPDATE ${table} SET message_body = ? WHERE message_name = ? AND repository_name = ?</sql>

    <!-- Statements used to update the attributes of a message stored in this repository. -->
    <sql name="updateMessageAttributesSQL">UPDATE ${table} SET message_attributes = ? WHERE message_name = ? AND repository_name = ?</sql>

    <!-- Statements used to insert a message into this repository. -->
    <sql name="insertMessageSQL">INSERT INTO ${table} (message_name,
    repository_name, message_state, error_message, sender, recipients,
    remote_host, remote_addr, last_updated, message_body,
    message_attributes) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)</sql>

    <!-- Statements used to retrieve a message stored in this repository. -->
    <sql name="retrieveMessageSQL">SELECT message_state, error_message, sender, recipients, remote_host, remote_addr, last_updated FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>

    <!-- Statements used to retrieve the body of a message stored in this repository. -->
    <sql name="retrieveMessageBodySQL">SELECT message_body FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>

    <!-- Statements used to retrieve the attributes of a message stored in this repository. -->
    <sql name="retrieveMessageAttributesSQL">SELECT message_attributes FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>

    <!-- Statements used to retrieve the size of the body of a message stored in this repository. -->
    <!-- NOTE: This statement is optional and need not be implemented for a particular database to be supported. -->
    <sql name="retrieveMessageBodySizeSQL" db="mssql">SELECT datalength(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>
    <sql name="retrieveMessageBodySizeSQL" db="mysql">SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>
    <sql name="retrieveMessageBodySizeSQL" db="hypersonic">SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>
    <sql name="retrieveMessageBodySizeSQL" db="hsqldb">SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>
    <sql name="retrieveMessageBodySizeSQL" db="postgresql">SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>
    <sql name="retrieveMessageBodySizeSQL" db="oracle">SELECT dbms_lob.getlength(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>
	<sql name="retrieveMessageBodySizeSQL" db="dm">SELECT dbms_lob.getlength(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>
    <sql name="retrieveMessageBodySizeSQL" db="db2">SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>
    <sql name="retrieveMessageBodySizeSQL" db="ingres">SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>
    <sql name="retrieveMessageBodySizeSQL" db="derby">SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>

    <!-- Statements used to delete a message stored in this repository. -->
    <sql name="removeMessageSQL">DELETE FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>

    <!-- Statements used to list all messages stored in this repository. -->
    <sql name="listMessagesSQL">SELECT message_name, message_state, last_updated FROM ${table} WHERE repository_name = ? ORDER BY last_updated ASC</sql>

    <!-- Statements used to create the table associated with this class. -->
    <sql name="createTable" db="mysql">
        CREATE TABLE ${table} (
            message_name varchar (200) NOT NULL,
            repository_name varchar (100) NOT NULL,
            message_state varchar (30) NOT NULL ,
            error_message varchar (200) NULL ,
            sender varchar (255) NULL ,
            recipients text NOT NULL ,
            remote_host varchar (255) NOT NULL ,
            remote_addr varchar (20) NOT NULL ,
            message_body longblob NOT NULL ,
            message_attributes longblob NULL ,
            last_updated datetime NOT NULL,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
    <sql name="createTable" db="hypersonic">
        CREATE CACHED TABLE ${table} (
            message_name varchar (200) NOT NULL,
            repository_name varchar (255) NOT NULL,
            message_state varchar (30) NOT NULL ,
            error_message varchar (200) NULL ,
            sender varchar (255) NULL ,
            recipients varchar NOT NULL ,
            remote_host varchar (255) NOT NULL ,
            remote_addr varchar (20) NOT NULL ,
            message_body varchar NOT NULL ,
            message_attributes varchar NULL ,
            last_updated timestamp NOT NULL,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
    <sql name="createTable" db="hsqldb">
        CREATE CACHED TABLE ${table} (
            message_name varchar (200) NOT NULL,
            repository_name varchar (255) NOT NULL,
            message_state varchar (30) NOT NULL ,
            error_message varchar (200) NULL ,
            sender varchar (255) NULL ,
            recipients varchar NOT NULL ,
            remote_host varchar (255) NOT NULL ,
            remote_addr varchar (20) NOT NULL ,
            message_body varchar NOT NULL ,
            message_attributes varchar NULL ,
            last_updated timestamp NOT NULL,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
    <sql name="createTable" db="mssql">
        CREATE TABLE [${table}] (
            [message_name] [varchar] (200) NOT NULL,
            [repository_name] [varchar] (255) NOT NULL,
            [message_state] [varchar] (30) NOT NULL ,
            [error_message] [varchar] (1000) NULL ,
            [sender] [varchar] (255) NULL ,
            [recipients] [text] NOT NULL ,
            [remote_host] [varchar] (255) NOT NULL ,
            [remote_addr] [varchar] (20) NOT NULL ,
            [message_body] [image] NOT NULL ,
            [message_attributes] [image] NULL ,
            [last_updated] [datetime] NOT NULL,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
    <sql name="createTable" db="oracle">
        CREATE TABLE ${table} (
            message_name varchar2(200) NOT NULL ,
            repository_name varchar2(255) NOT NULL ,
            message_state varchar2(30) NOT NULL ,
            error_message varchar2(200) NULL ,
            sender varchar2(255) ,
            recipients varchar2(1000) NOT NULL ,
            remote_host varchar2(100) NOT NULL ,
            remote_addr varchar2(20) NOT NULL ,
            message_body blob NOT NULL ,
            message_attributes blob NULL ,
            last_updated date NOT NULL ,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
	<sql name="createTable" db="dm">
        CREATE TABLE ${table} (
            message_name varchar2(200) NOT NULL ,
            repository_name varchar2(255) NOT NULL ,
            message_state varchar2(30) NOT NULL ,
            error_message varchar2(200) NULL ,
            sender varchar2(255) ,
            recipients varchar2(1000) NOT NULL ,
            remote_host varchar2(100) NOT NULL ,
            remote_addr varchar2(20) NOT NULL ,
            message_body blob NOT NULL ,
            message_attributes blob NULL ,
            last_updated date NOT NULL ,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
    <sql name="createTable" db="postgresql">
        CREATE TABLE ${table} (
            message_name varchar (200) NOT NULL,
            repository_name varchar (255) NOT NULL,
            message_state varchar (30) NOT NULL ,
            error_message varchar (200) NULL ,
            sender varchar (255) NULL ,
            recipients text NOT NULL ,
            remote_host varchar (255) NOT NULL ,
            remote_addr varchar (20) NOT NULL ,
            message_body bytea NOT NULL ,
            message_attributes bytea NULL ,
            last_updated timestamp NOT NULL,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
    <sql name="createTable" db="sapdb">
        CREATE TABLE ${table} (
            message_name varchar (200) NOT NULL,
            repository_name varchar (200) NOT NULL,
            message_state varchar (30) NOT NULL ,
            error_message varchar (200) NULL ,
            sender varchar (200) NULL ,
            recipients long NOT NULL ,
            remote_host varchar (100) NOT NULL ,
            remote_addr varchar (20) NOT NULL ,
            message_body long byte NOT NULL ,
            message_attributes long byte NULL ,
            last_updated date NOT NULL,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
    <sql name="createTable" db="db2">
        CREATE TABLE ${table} (
            message_name varchar(200) NOT NULL ,
            repository_name varchar(255) NOT NULL ,
            message_state varchar(30) NOT NULL ,
            error_message varchar(200) ,
            sender varchar(255) ,
            recipients varchar(1000) NOT NULL ,
            remote_host varchar(100) NOT NULL ,
            remote_addr varchar(20) NOT NULL ,
            message_body blob NOT NULL ,
            message_attributes blob ,
            last_updated timestamp NOT NULL ,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
    <sql name="createTable" db="ingres">
        CREATE TABLE ${table} (
            message_name varchar (200) NOT NULL,
            repository_name varchar (255) NOT NULL,
            message_state varchar (30) NOT NULL ,
            error_message varchar (200) ,
            sender varchar (255) ,
            recipients LONG VARCHAR NOT NULL ,
            remote_host varchar (255) NOT NULL ,
            remote_addr varchar (20) NOT NULL ,
            message_body LONG BYTE NOT NULL ,
            message_attributes LONG BYTE ,
            last_updated DATE NOT NULL
        )
    </sql>
    <sql name="createTable" db="derby">
        CREATE TABLE ${table} (
            message_name varchar (200) NOT NULL,
            repository_name varchar (255) NOT NULL,
            message_state varchar (30) NOT NULL ,
            error_message varchar (200) ,
            sender varchar (255) ,
            recipients long varchar NOT NULL ,
            remote_host varchar (255) NOT NULL ,
            remote_addr varchar (20) NOT NULL ,
            message_body blob NOT NULL ,
            message_attributes blob ,
            last_updated timestamp NOT NULL,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
</sqlDefs>

<!-- SQL statements to support the JDBCSpoolRepository class -->
<!-- -->
<!-- The JDBCSpoolRepository allows James to use a JDBC compliant database -->
<!-- to hold messages that are on the spool. -->
<sqlDefs name="org.apache.james.mailrepository.JDBCSpoolRepository">

    <!-- Statements used to check whether a particular message exists in this repository. -->
    <sql name="checkMessageExistsSQL">SELECT count(*) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>

    <!-- Statements used to update a message stored in this repository. -->
    <sql name="updateMessageSQL">UPDATE ${table} SET message_state = ?, error_message = ?, sender = ?, recipients = ?, remote_host = ?, remote_addr = ?, last_updated = ? WHERE message_name = ? AND repository_name = ?</sql>

    <!-- Statements used to update the body of a message stored in this repository. -->
    <sql name="updateMessageBodySQL">UPDATE ${table} SET message_body = ? WHERE message_name = ? AND repository_name = ?</sql>

    <!-- Statements used to update the attributes of a message stored in this repository. -->
    <sql name="updateMessageAttributesSQL">UPDATE ${table} SET message_attributes = ? WHERE message_name = ? AND repository_name = ?</sql>

    <!-- Statements used to insert a message into this repository. -->
    <sql name="insertMessageSQL">INSERT INTO ${table} (message_name,
    repository_name, message_state, error_message, sender, recipients,
    remote_host, remote_addr, last_updated, message_body,
    message_attributes) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)</sql>

    <!-- Statements used to retrieve a message stored in this repository. -->
    <sql name="retrieveMessageSQL">SELECT message_state, error_message, sender, recipients, remote_host, remote_addr, last_updated FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>

    <!-- Statements used to retrieve the body of a message stored in this repository. -->
    <sql name="retrieveMessageBodySQL">SELECT message_body FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>

    <!-- Statements used to retrieve the attributes of a message stored in this repository. -->
    <sql name="retrieveMessageAttributesSQL">SELECT message_attributes FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>
    
    <!-- Statements used to retrieve the size of the body of a message stored in this repository. -->
    <!-- NOTE: This statement is optional and need not be implemented for a particular database to be supported. -->
    <sql name="retrieveMessageBodySizeSQL" db="mssql">SELECT datalength(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>
    <sql name="retrieveMessageBodySizeSQL" db="mysql">SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>
    <sql name="retrieveMessageBodySizeSQL" db="hypersonic">SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>
    <sql name="retrieveMessageBodySizeSQL" db="hsqldb">SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>
    <sql name="retrieveMessageBodySizeSQL" db="postgresql">SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>
    <sql name="retrieveMessageBodySizeSQL" db="oracle">SELECT dbms_lob.getlength(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>
	<sql name="retrieveMessageBodySizeSQL" db="dm">SELECT dbms_lob.getlength(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>
    <sql name="retrieveMessageBodySizeSQL" db="db2">SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>
    <sql name="retrieveMessageBodySizeSQL" db="ingres">SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>

    <!-- Statements used to delete a message stored in this repository. -->
    <sql name="removeMessageSQL">DELETE FROM ${table} WHERE message_name = ? AND repository_name = ?</sql>

    <!-- Statements used to list all messages stored in this repository. -->
    <sql name="listMessagesSQL">SELECT message_name, message_state, last_updated, error_message FROM ${table} WHERE repository_name = ? ORDER BY last_updated ASC</sql>

    <!-- Statements used to create the table associated with this class. -->
    <sql name="createTable" db="hypersonic">
        CREATE TABLE ${table} (
            message_name varchar (200) NOT NULL,
            repository_name varchar (255) NOT NULL,
            message_state varchar (30) NOT NULL ,
            error_message varchar (200) NULL ,
            sender varchar (255) NULL ,
            recipients varchar NOT NULL ,
            remote_host varchar (255) NOT NULL ,
            remote_addr varchar (20) NOT NULL ,
            message_body varchar NOT NULL ,
            message_attributes varchar NULL ,
            last_updated timestamp NOT NULL,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
    <sql name="createTable" db="hsqldb">
        CREATE CACHED TABLE ${table} (
            message_name varchar (200) NOT NULL,
            repository_name varchar (255) NOT NULL,
            message_state varchar (30) NOT NULL ,
            error_message varchar (200) NULL ,
            sender varchar (255) NULL ,
            recipients varchar NOT NULL ,
            remote_host varchar (255) NOT NULL ,
            remote_addr varchar (20) NOT NULL ,
            message_body varchar NOT NULL ,
            message_attributes varchar NULL ,
            last_updated timestamp NOT NULL,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
    <sql name="createTable" db="mysql">
        CREATE TABLE ${table} (
            message_name varchar (200) NOT NULL,
            repository_name varchar (100) NOT NULL,
            message_state varchar (30) NOT NULL ,
            error_message varchar (200) NULL ,
            sender varchar (255) NULL ,
            recipients text NOT NULL ,
            remote_host varchar (255) NOT NULL ,
            remote_addr varchar (20) NOT NULL ,
            message_body longblob NOT NULL ,
            message_attributes longblob NULL ,
            last_updated datetime NOT NULL,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
    <sql name="createTable" db="mssql">
        CREATE TABLE [${table}] (
            [message_name] [varchar] (200) NOT NULL,
            [repository_name] [varchar] (255) NOT NULL,
            [message_state] [varchar] (30) NOT NULL ,
            [error_message] [varchar] (1000) NULL ,
            [sender] [varchar] (255) NULL ,
            [recipients] [text] NOT NULL ,
            [remote_host] [varchar] (255) NOT NULL ,
            [remote_addr] [varchar] (20) NOT NULL ,
            [message_body] [image] NOT NULL ,
            [message_attributes] [image] NULL ,
            [last_updated] [datetime] NOT NULL,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
    <sql name="createTable" db="oracle">
        CREATE TABLE ${table} (
            message_name varchar2(200) NOT NULL ,
            repository_name varchar2(255) NOT NULL ,
            message_state varchar2(30) NOT NULL ,
            error_message varchar2(200) NULL ,
            sender varchar2(255) NULL ,
            recipients varchar2(1000) NOT NULL ,
            remote_host varchar2(255) NOT NULL ,
            remote_addr varchar2(20) NOT NULL ,
            message_body blob NOT NULL ,
            message_attributes blob NULL ,
            last_updated date NOT NULL ,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
	<sql name="createTable" db="dm">
        CREATE TABLE ${table} (
            message_name varchar2(200) NOT NULL ,
            repository_name varchar2(255) NOT NULL ,
            message_state varchar2(30) NOT NULL ,
            error_message varchar2(200) NULL ,
            sender varchar2(255) NULL ,
            recipients varchar2(1000) NOT NULL ,
            remote_host varchar2(255) NOT NULL ,
            remote_addr varchar2(20) NOT NULL ,
            message_body blob NOT NULL ,
            message_attributes blob NULL ,
            last_updated date NOT NULL ,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
    <sql name="createTable" db="postgresql">
        CREATE TABLE ${table} (
            message_name varchar (200) NOT NULL,
            repository_name varchar (255) NOT NULL,
            message_state varchar (30) NOT NULL ,
            error_message varchar (200) NULL ,
            sender varchar (255) NULL ,
            recipients text NOT NULL ,
            remote_host varchar (255) NOT NULL ,
            remote_addr varchar (20) NOT NULL ,
            message_body bytea NOT NULL ,
            message_attributes bytea NULL ,
            last_updated timestamp NOT NULL,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
    <sql name="createTable" db="sapdb">
        CREATE TABLE ${table} (
            message_name varchar (200) NOT NULL,
            repository_name varchar (255) NOT NULL,
            message_state varchar (30) NOT NULL ,
            error_message varchar (200) NULL ,
            sender varchar (255) NULL ,
            recipients long NOT NULL ,
            remote_host varchar (255) NOT NULL ,
            remote_addr varchar (20) NOT NULL ,
            message_body long byte NOT NULL ,
            message_attributes long byte NULL ,
            last_updated date NOT NULL,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
    <sql name="createTable" db="db2">
        CREATE TABLE ${table} (
            message_name varchar(200) NOT NULL ,
            repository_name varchar(255) NOT NULL ,
            message_state varchar(30) NOT NULL ,
            error_message varchar(200) ,
            sender varchar(255) ,
            recipients varchar(1000) NOT NULL ,
            remote_host varchar(100) NOT NULL ,
            remote_addr varchar(20) NOT NULL ,
            message_body blob NOT NULL ,
            message_attributes blob ,
            last_updated timestamp NOT NULL ,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
    <sql name="createTable" db="ingres">
        CREATE TABLE ${table} (
            message_name varchar (200) NOT NULL,
            repository_name varchar (255) NOT NULL,
            message_state varchar (30) NOT NULL ,
            error_message varchar (200) ,
            sender varchar (255) ,
            recipients LONG VARCHAR NOT NULL ,
            remote_host varchar (255) NOT NULL ,
            remote_addr varchar (20) NOT NULL ,
            message_body LONG BYTE NOT NULL ,
            message_attributes LONG BYTE ,
            last_updated DATE NOT NULL
        )
    </sql>
    <sql name="createTable" db="derby">
        CREATE TABLE ${table} (
            message_name varchar (200) NOT NULL,
            repository_name varchar (255) NOT NULL,
            message_state varchar (30) NOT NULL ,
            error_message varchar (200) ,
            sender varchar (255) ,
            recipients long varchar NOT NULL ,
            remote_host varchar (255) NOT NULL ,
            remote_addr varchar (20) NOT NULL ,
            message_body blob NOT NULL ,
            message_attributes blob ,
            last_updated timestamp NOT NULL,
            PRIMARY KEY (repository_name, message_name)
        )
    </sql>
</sqlDefs>

<!-- SQL statements to support the BayesianAnalysis and the BayesianAnalysisFeeder mailets -->
<!-- -->
<sqlDefs name="org.apache.james.util.JDBCBayesianAnalyzer">

    <sql name="hamTableName">bayesiananalysis_ham</sql>
    <sql name="spamTableName">bayesiananalysis_spam</sql>
    <sql name="messageCountsTableName">bayesiananalysis_messagecounts</sql>

    <!-- Statements used to retrieve the message counts. -->
    <sql name="selectMessageCounts">SELECT HAMCOUNT, SPAMCOUNT FROM bayesiananalysis_messagecounts</sql>

    <!-- Statements used to initialize the message counts. -->
    <sql name="initializeMessageCounts">INSERT INTO bayesiananalysis_messagecounts (HAMCOUNT, SPAMCOUNT) VALUES (0,0)</sql>

    <!-- Statements used to update the ham message counts. -->
    <sql name="updateHamMessageCounts">UPDATE bayesiananalysis_messagecounts SET HAMCOUNT=(HAMCOUNT + ?)</sql>

    <!-- Statements used to update the spam message counts. -->
    <sql name="updateSpamMessageCounts">UPDATE bayesiananalysis_messagecounts SET SPAMCOUNT=(SPAMCOUNT + ?)</sql>

    <!-- Statements used to retrieve the ham token counts. -->
    <sql name="selectHamTokens">SELECT TOKEN, OCCURRENCES FROM bayesiananalysis_ham</sql>

    <!-- Statements used to retrieve the spam token counts. -->
    <sql name="selectSpamTokens">SELECT TOKEN, OCCURRENCES FROM bayesiananalysis_spam</sql>

    <!-- Statements used to insert the ham token counts. -->
    <sql name="insertHamToken">INSERT INTO bayesiananalysis_ham (TOKEN, OCCURRENCES) VALUES (?,?)</sql>

    <!-- Statements used to insert the spam token counts. -->
    <sql name="insertSpamToken">INSERT INTO bayesiananalysis_spam (TOKEN, OCCURRENCES) VALUES (?,?)</sql>

    <!-- Statements used to update the ham token counts. -->
    <sql name="updateHamToken">UPDATE bayesiananalysis_ham SET OCCURRENCES=(OCCURRENCES + ?) WHERE (TOKEN=?)</sql>

    <!-- Statements used to update the spam token counts. -->
    <sql name="updateSpamToken">UPDATE bayesiananalysis_spam SET OCCURRENCES=(OCCURRENCES + ?) WHERE (TOKEN=?)</sql>

    <!-- Statements used to delete ham tokens. -->
    <sql name="deleteHamTokens">DELETE FROM bayesiananalysis_ham</sql>
    
    <!-- Statements used to delete spam tokens. -->
    <sql name="deleteSpamTokens">DELETE FROM bayesiananalysis_spam</sql>
    
    <!-- Statements used to delete message counts. -->
    <sql name="deleteMessageCounts">DELETE FROM bayesiananalysis_messagecounts</sql>


    <!-- Statements used to create the "ham" table (the 'token' field must be case sensitive). -->
    <sql name="createHamTable" db="mysql">
        CREATE TABLE bayesiananalysis_ham (
            token varchar(128) binary NOT NULL default '',
            occurrences int(11) NOT NULL default '0',
            PRIMARY KEY (token)
        ) TYPE=InnoDB
    </sql>
    <sql name="createHamTable" db="mssql">
        CREATE TABLE [bayesiananalysis_ham] (
        [token] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL,
        [occurrences] [int] NOT NULL default (0),
            PRIMARY KEY (token)
        )
    </sql>
    <sql name="createHamTable" db="derby">
        CREATE TABLE bayesiananalysis_ham (
            token varchar(128) NOT NULL,
            occurrences INTEGER NOT NULL default 0,
            PRIMARY KEY (token)
        )
    </sql>
    <sql name="createHamTable" db="postgresql">
        CREATE TABLE bayesiananalysis_ham (
            token varchar(128) NOT NULL,
            occurrences int NOT NULL default 0,
            PRIMARY KEY (token)
        )
    </sql>

    <!-- Statements used to create the "spam" table (the 'token' field must be case sensitive). -->
    <sql name="createSpamTable" db="mysql">
        CREATE TABLE bayesiananalysis_spam (
            token varchar(128) binary NOT NULL default '',
            occurrences int(11) NOT NULL default '0',
            PRIMARY KEY (token)
        ) TYPE=InnoDB
    </sql>
    <sql name="createSpamTable" db="mssql">
        CREATE TABLE [bayesiananalysis_spam] (
        [token] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL,
        [occurrences] [int] NOT NULL default (0),
            PRIMARY KEY (token)
        )
    </sql>
    <sql name="createSpamTable" db="derby">
        CREATE TABLE bayesiananalysis_spam (
            token varchar (128) NOT NULL,
            occurrences INTEGER  NOT NULL default 0,
            PRIMARY KEY (token)
        )
    </sql>
    <sql name="createSpamTable" db="postgresql">
        CREATE TABLE bayesiananalysis_spam (
            token varchar (128) NOT NULL,
            occurrences int  NOT NULL default 0,
            PRIMARY KEY (token)
        )
    </sql>

    <!-- Statements used to create the "message counts" table. -->
    <sql name="createMessageCountsTable" db="mysql">
        CREATE TABLE bayesiananalysis_messagecounts (
            hamcount int(11) NOT NULL default '0',
            spamcount int(11) NOT NULL default '0'
        ) TYPE=InnoDB
    </sql>
    <sql name="createMessageCountsTable" db="mssql">
        CREATE TABLE [bayesiananalysis_messagecounts] (
        [hamcount] [int] NOT NULL default (0),
        [spamcount] [int] NOT NULL default (0)
        )
    </sql>
    <sql name="createMessageCountsTable" db="derby">
        CREATE TABLE bayesiananalysis_messagecounts (
            hamcount INTEGER NOT NULL default 0,
            spamcount INTEGER  NOT NULL default 0
        )
    </sql>
    <sql name="createMessageCountsTable" db="postgresql">
        CREATE TABLE bayesiananalysis_messagecounts (
            hamcount int NOT NULL default 0,
            spamcount int  NOT NULL default 0
        )
    </sql>
</sqlDefs>

<!-- SQL statements to support the WhiteListManager mailet and the IsInWhiteList matcher -->
<!-- -->
<sqlDefs name="WhiteList">

    <sql name="whiteListTableName">whitelist</sql>

    <!-- Statements used to retrieve a single entry. -->
    <sql name="selectByPK">SELECT localUser, localHost FROM whitelist where (localUser=? AND localHost=? AND remoteUser=? AND remoteHost=?)</sql>

    <!-- Statements used to all entries by sender address. -->
    <sql name="selectBySender">SELECT remoteUser, remoteHost FROM whitelist where (localUser=? AND localHost=?) ORDER BY remoteUser, remoteHost</sql>

    <!-- Statements used to insert an entry. -->
    <sql name="insert">INSERT INTO whitelist (localUser, localHost, remoteUser, remoteHost) VALUES (?,?,?,?)</sql>

    <!-- Statements used to delete an entry. -->
    <sql name="deleteByPK">DELETE FROM whitelist where (localUser=? AND localHost=? AND remoteUser=? AND remoteHost=?)</sql>

    <!-- Statements used to create the "whitelist" table. -->
    <sql name="createWhiteListTable" db="hypersonic">
        CREATE TABLE whitelist (
            localUser varchar (64) NOT NULL,
            localHost varchar (255) NOT NULL,
            remoteUser varchar (64) NOT NULL,
            remoteHost varchar (255) NOT NULL,
            PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
        )    </sql>
    <sql name="createWhiteListTable" db="hsqldb">
        CREATE CACHED TABLE ${table} (
        CREATE TABLE whitelist (
            localUser varchar (64) NOT NULL,
            localHost varchar (255) NOT NULL,
            remoteUser varchar (64) NOT NULL,
            remoteHost varchar (255) NOT NULL,
            PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
        )    </sql>
    <sql name="createWhiteListTable" db="mysql">
        CREATE TABLE whitelist (
            localUser varchar (64) NOT NULL,
            localHost varchar (255) character set latin1 NOT NULL,
            remoteUser varchar (64) NOT NULL,
            remoteHost varchar (255) character set latin1 NOT NULL,
            PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
        ) TYPE=InnoDB
    </sql>
    <sql name="createWhiteListTable" db="mssql">
        CREATE TABLE [whitelist] (
            [localUser] [varchar] (64) NOT NULL,
            [localHost] [varchar] (255) NOT NULL,
            [remoteUser] [varchar] (64) NOT NULL,
            [remoteHost] [varchar] (255) NOT NULL,
            PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
        )
    </sql>
    <sql name="createWhiteListTable" db="oracle">
        CREATE TABLE whitelist (
            localUser varchar (64) NOT NULL,
            localHost varchar (255) NOT NULL,
            remoteUser varchar (64) NOT NULL,
            remoteHost varchar (255) NOT NULL,
            PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
        )
    </sql>
	<sql name="createWhiteListTable" db="dm">
        CREATE TABLE whitelist (
            localUser varchar (64) NOT NULL,
            localHost varchar (255) NOT NULL,
            remoteUser varchar (64) NOT NULL,
            remoteHost varchar (255) NOT NULL,
            PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
        )
    </sql>
    <sql name="createWhiteListTable" db="postgresql">
        CREATE TABLE whitelist (
            localUser varchar (64) NOT NULL,
            localHost varchar (255) NOT NULL,
            remoteUser varchar (64) NOT NULL,
            remoteHost varchar (255) NOT NULL,
            PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
        )
    </sql>
    <sql name="createWhiteListTable" db="sapdb">
        CREATE TABLE whitelist (
            localUser varchar (64) NOT NULL,
            localHost varchar (255) NOT NULL,
            remoteUser varchar (64) NOT NULL,
            remoteHost varchar (255) NOT NULL,
            PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
        )
    </sql>
    <sql name="createWhiteListTable" db="db2">
        CREATE TABLE whitelist (
            localUser varchar (64) NOT NULL,
            localHost varchar (255) NOT NULL,
            remoteUser varchar (64) NOT NULL,
            remoteHost varchar (255) NOT NULL,
            PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
        )
    </sql>
    <sql name="createWhiteListTable" db="ingres">
        CREATE TABLE whitelist (
            localUser varchar (64) NOT NULL,
            localHost varchar (255) NOT NULL,
            remoteUser varchar (64) NOT NULL,
            remoteHost varchar (255) NOT NULL,
            PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
        )
    </sql>
    <sql name="createWhiteListTable" db="derby">
        CREATE TABLE whitelist (
            localUser varchar (64) NOT NULL,
            localHost varchar (255) NOT NULL,
            remoteUser varchar (64) NOT NULL,
            remoteHost varchar (255) NOT NULL,
            PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
        )
    </sql>

</sqlDefs>

</sqlResources>

 关键字dm,其实就是复制一下oracle的sql,然后有特殊语句就自己修改一下


启动报错:

如果启动报错,可以在james-2.3.2\apps\james\logs查看日志

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2151326.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

k8s部署jenkins集群时,使用ThinBackup进行定期备份

一、背景 使用k8s部署jenkins集群的时候&#xff0c;一般会把$JENKSIN_HOME&#xff08;默认是/var/jenkins_home&#xff09;进行持久化。 volumeMounts:- name: jenkins-homemountPath: /var/jenkins_home这样&#xff0c;机器重启&#xff0c;保证不会丢失文件。 本文要讲…

杀死端口占用的进程

1、查看端口的进程&#xff0c;以9023为例 &#xff08;1&#xff09;方法1 netstat -tunpl|grep 9023 &#xff08;2&#xff09;方法2 ss -tulpan |grep 9023 &#xff08;3&#xff09;方法3 netstat -ntlp |grep 9023 &#xff08;4&#xff09;方法4 lsof -i:9023 …

Linux:虚拟文件系统/proc和self进程

相关阅读 Linuxhttps://blog.csdn.net/weixin_45791458/category_12234591.html?spm1001.2014.3001.5482 /proc目录 在Linux操作系统中&#xff0c;目录/proc是一个虚拟文件系统&#xff0c;称为procfc&#xff0c;用于访问内核和系统的实时状态信息。这个文件系统不同于常规…

下载 B 站封面的正确方式

B 友们经常用一些很好看的图片作为视频封面&#xff0c;但是大部分都不会指出图片来源&#xff0c;为此我们可以下载封面原图&#xff0c;用于保存或者搜索源出处。 这里介绍几个我知道的方法&#xff0c;欢迎补充&#x1f914; ‍ 使用相关客户端 上一篇博客介绍了很多的能…

基于微型5G网关的酒店服务机器人应用

智能机器人在酒店中已经越来越常见&#xff0c;并且也是提升客户体验、提高服务效率的重要工具。然而&#xff0c;尽管这些机器人在自动化服务方面可以发挥着重要作用&#xff0c;但它们仍然面临着一些通信、组网和在线管理方面的痛点。 针对这些难题&#xff0c;可以通过部署微…

【数据结构入门】排序算法之三路划分与非比较排序

文章目录 前言 一、三路划分优化 1.1. 基本思想 1.2. 实现步骤 1.3. 优点 1.4 代码实现 二、非比较排序 2.1 计数排序 2.1.1基本思想 2.1.2具体步骤 2.1.3算法特性 2.1.4算法实现 2.2 基数排序 2.2.1基本思想 2.2.2具体步骤 2.2.3 基数排序的方法 2.2.4算法特…

【高等代数笔记】线性空间(五-九)

3. 线性空间 主线任务&#xff1a;研究线性空间和它的子空间的结构 研究平面 π \pi π上向量共线与不共线的问题&#xff1a; c ⃗ \vec{c} c 与 a ⃗ ≠ 0 \vec{a}\ne\boldsymbol{0} a 0共线 c ⃗ λ a ⃗ ⇔ λ ∈ R ⇔ − λ a ⃗ 1 c ⃗ 0 ⃗ \vec{c}\lambda\vec{…

【白皮书下载】分布式功能安全的创新与突破

近日&#xff0c;Imagination 推出全新性能最高且具有高等级功能安全性的汽车 GPU IP——Imagination DXS GPU&#xff0c;并且是Imagination 第一款带有“分布式安全机制”的处理器。 下载白皮书&#xff0c;获取完整分布式安全机制解决方案 根据 ISO 26262 汽车安全完整性等级…

STL 源码剖析 | 第1章:概论

STL 是一套程序库 1、STL 概论 1、从子程序、程序、函数、类别&#xff0c;到函数库、类别库、各种组件&#xff0c;从结构化设计、模块化设计、面向对象设计&#xff0c;到模式的归纳整理 为的就是 复用性 的提升 复用性 必须建立在某种标准之上 —— 不论是 语言层次的标…

关于MATLAB计算3维图的向量夹角总是不正确的问题记录

文章目录 问题描述解决方法完整代码 问题描述 因为最近在做无人机的一个项目&#xff0c;所以需要画出无人机的轨迹&#xff0c;然后再提取特征值&#xff0c;我这里在计算夹角的时候发现为什么在视觉上明明看的是钝角但是实际计算出来却是锐角的角度。 如下图所示&#xff0c…

大觅网之环境部署(Environment Deployment of Da Mi Network)

&#x1f49d;&#x1f49d;&#x1f49d;欢迎来到我的博客&#xff0c;很高兴能够在这里和您见面&#xff01;希望您在这里可以感受到一份轻松愉快的氛围&#xff0c;不仅可以获得有趣的内容和知识&#xff0c;也可以畅所欲言、分享您的想法和见解。 推荐:Linux运维老纪的首页…

数据保护从现在开始:如何抵御 .[RestoreBackup@cock.li].SRC 勒索病毒

导言 勒索病毒是一种不断演变的网络威胁&#xff0c;.[RestoreBackupcock.li].SRC、[chewbaccacock.li].SRC勒索病毒便是其中一种新型的攻击手段。该病毒通过加密用户文件并要求支付赎金来恢复访问&#xff0c;给个人和企业带来了严重的安全风险和经济损失。本文91数据恢复将探…

uniapp使用uview2上传图片功能

官网地址Upload 上传 | uView 2.0 - 全面兼容 nvue 的 uni-app 生态框架 - uni-app UI 框架 前提&#xff0c;需要下载vuew2插件 <view class"upload"><view class"u-demo-block__content"><view class"u-page__upload-item"&…

进程状态的优先级

1.进程的状态&#xff08;所有系统&#xff09; 因为是对于所有系统的&#xff0c;所以描述会很抽象。 补充知识&#xff1a; 并行和并发 并行&#xff1a;多个进程再多个cpu下分别同时运行并发&#xff1a;多个进程在一个cpu下采取进程切换的方式&#xff0c;在一段时间内&…

fiddler抓包06_抓取https请求(chrome)

课程大纲 首次安装Fiddler&#xff0c;抓https请求&#xff0c;除打开抓包功能&#xff08;F12&#xff09;还需要&#xff1a; ① Fiddler开启https抓包 ② Fiddler导出证书&#xff1b; ③ 浏览器导入证书。 否则&#xff0c;无法访问https网站&#xff08;如下图&#xff0…

prometheus通过nginx-vts-exporter监控nginx

Prometheus监控nginx有两种方式。 一种是通过nginx-exporter监控&#xff0c;需要开启nginx_stub_status,主要是nginx自身的status信息&#xff0c;metrics数据相对较少&#xff1b; 另一种是使用nginx-vts-exporter监控&#xff0c;但是需要在编译nginx的时候添加nginx-module…

MyBatis 分批次执行(新增,修改,删除)

import com.google.common.collect.Lists;import java.util.Iterator; import java.util.List; import java.util.function.Consumer;/*** Description mybatis分批插入数据使用* Author WangKun* Date 2024/9/19 11:20* Version*/ public class MyBatisSqlUtils {/*** param d…

用户态缓存:高效数据交互与性能优化

目录 1. 用户态缓存区工作背景 1.1 为什么每条连接都需要读写缓存区 1.1.1 读缓存区&#xff08;Read Buffer&#xff09; 1.1.2 写缓存区&#xff08;Write Buffer&#xff09; 1.2 用户态缓存区的工作流程 1.3 用户态缓存区的重要性 2. UDP 和 TCP 的设计差异 2.1 UD…

神经网络 卷积层 参数共享

参数共享常用于神经网络卷积层中&#xff0c;共享的实际上就是说卷积核中的参数一直保持不变&#xff0c;如下所示就可以称为共享参数啦&#xff01;&#xff01;

C# 实时流转换为m3u8

主要通过FFmpeg 执行命令进行转换 FFmpeg 下载地址 命令行 ffmpeg -i "rtsp://your_rtsp_stream_address" -codec: copy -start_number 0 -hls_time 10 -hls_list_size 12 -f hls "output.m3u8"start_number 设置播放列表中最先播放的索引号&#xff0c;…