ホームページ バックエンド開発 PHPチュートリアル resin3.0 での hibernate2.1.2 接続の構成 mysql_PHP チュートリアル

resin3.0 での hibernate2.1.2 接続の構成 mysql_PHP チュートリアル

Jul 13, 2016 pm 05:03 PM
mysql 存在する 構成

resin3.0のmysqlに接続するようにhibernate2.1.2を設定します

レジン3.0でmysqlに接続するようにhibernate2.1.2を設定します

作者: ハマル

同意:

樹脂3は、樹脂3.0のインストールルートディレクトリを表します

hibernate2 は、hibernate2.1.2 のインストール ルート ディレクトリを表します



1. ウェブアプリケーションのルートを、resin3mydomain ディレクトリなどの、resin3 の下に確立します (mydomain のディレクトリ名は任意に選択でき、後で設定ファイルで設定できます)

2. 樹脂 3mydomain ディレクトリ内に、resin3mydomainWEB-INFclasses ディレクトリと樹脂 3mydomainWEB-INFlib ディレクトリを作成します。
これら 2 つのディレクトリは、この Web アプリケーション コンテキストのクラス ローダー検索パスに対応します (jar の場合はresin3mydomainWEB-INFlib、クラス ファイルの場合はresin3mydomainWEB-INFclasses)。これら 2 つのパスを、アプリケーション ライブラリ クラス パス (このアプリケーションに関連する jar クラス ライブラリの保存に使用) とコンテキスト クラス パス (このアプリケーションのクラス ファイルおよび XML 構成ファイルの保存に使用) と呼びます。
また、resin3lib ディレクトリと呼ばれるパスもあります。これをグローバル ライブラリ クラス パス (resin3 サーバーに保存され、サーバー上のすべての Web アプリケーションによって共有される関連する jar クラス ライブラリ) と呼びます。

3. この例では mysql データベースを使用するため、mysql jdbc ドライバーの jar パッケージ (mm.mysql-2.0.4-bin.jar) をresin3lib ディレクトリに配置します。その後、ドライバーはすべての Web アプリケーションで使用されます。

4. hibernate2 hibernate2.jar ファイルをresin3mydomainWEB-INFlibディレクトリにコピーし、次にhibernate2libディレクトリ内の必要なjarファイルをresin3mydomainWEB-INFlibディレクトリにコピーします。どのパッケージが必要かわからない場合は、hibernate2libREADME.txt ファイルを参照するか、より簡単に、hibernate2lib ディレクトリー内のすべての jar ファイルをresin3mydomainWEB-INFlib ディレクトリーにコピーします。

5. 次に、Resin の JDBC データベース接続プールの構成を開始します。樹脂3confresin.confファイルを変更します

a) Web アプリを検索し、Web アプリをカスタム アプリケーション ディレクトリ mydomain に置き換えます。

b) 要素を見つけて、このファイルのコメントは HTML スタイルのコメント メソッド を使用します。

c) 要素を次の形式に変更します

<データベース>

jdbc/mysql

<ドライバータイプ="org.gjt.mm.mysql.Driver">

                                                                                                                        
                                                         
                                                                 


<準備されたステートメントのキャッシュ サイズ>8

20最大接続数>

30 秒最大アイドル時間>



以上で、Resin の jdbc コネクションプールの設定が完了しました。

6. hibernate2src ディレクトリー内の hibernate.properties、log4j.properties、および oscache.properties ファイルを、resin3 mydomainWEB-INFclasses ディレクトリーにコピーします。

7. mysql データベースを使用しているため、hibernate.properties ファイル内の mysql 部分の構成を変更し、元のデフォルトの HypersonicSQL 構成をコメントアウトします。コメントの設定は、文の前に # 記号を追加することです。例:

#hibernate.dialect net.sf.hibernate.dialect.HSQLDialect



以下は典型的な mysql 構成です:

hibernate.dialect net.sf.hibernate.dialect.MySQLDialect

hibernate.connection.driver_class org.gjt.mm.mysql.Driver

hibernate.connection.driver_class com.mysql.jdbc.Driver

hibernate.connection.url jdbc:mysql://192.162.125.3:3306/mydb

hibernate.connection.username root

hibernate.connection.password 12345678



変更する必要があるのは次の 3 行です:

URL は JDBC 接続記述子を指し、形式は jdbc:mysql://データベース IP:ポート番号/データベース名です

ユーザー名はデータベースへのログインに使用されるユーザー名を指します

パスワードこのユーザーのパスワード



8. Hibernate と樹脂のデータベース接続プールをバインドします。ディレクトリ内に hibernate.cfg.xml ファイルを作成します。 ファイルの内容は次のとおりです




PUBLIC "-//Hibernate/Hibernate 構成 DTD//EN"

「http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd」>

<休止状態構成>



,,,,,,,,、
&lt;プロパティ名= "show_sql"&gt; true&lt;/property&gt;

,,、、
                                                                                                   
                                                                                         




要素は、データベースに接続するために樹脂で定義された jndi を使用するように Hibernate に指示します。
これは、User.hbm.xml が永続クラス User に対応する Hibernate XML マッピング ファイルであることを宣言します。このファイルには、POJO クラスをデータベース テーブル (または複数のデータベース テーブル) にマップするメタデータが含まれています。このドキュメントについては後ほど説明します。まずこの POJO クラスを作成してから、それを宣言するマッピング メタデータを見てみましょう。

9. mysql でユーザー テーブルを作成します。テーブルの形式は次のとおりです。
User_id パスワード ニックネーム E_mail
1 6666 ハマル hamal@sohu.com
2 6666 吸血鬼吸血鬼@sina.com
3 6666 アンデ ande@yahoo.com

resin3 mydomainWEB-INFclasses ディレクトリに 3 つの新しい Java ファイル、Test.java、HibernateUtil.java、および User.java を作成します。



HibernateUtil.java のソース コードは次のとおりです。 このクラスは、静的な SessionFactory を取得するために使用される補助クラスであり、データベースを担当し、1 つの XML 設定ファイル (hibernate.cfg.xml) にのみ対応します。



net.sf.hibernate.*;
をインポートします
インポート net.sf.hibernate.cfg.*;



パブリック クラス HibernateUtil {



プライベート静的最終セッションファクトリー sessionFactory;



静的{

試してみてください{

sessionFactory = new Configuration().configure().buildSessionFactory();

} catch (HibernateException ex) {

throw new RuntimeException("SessionFactory 構築時の例外: " + ex.getMessage(), ex);

}

}



パブリック静的最終 ThreadLocal セッション = new ThreadLocal();



パブリック静的セッション currentSession() が HibernateException をスローする {

セッション s = (セッション) session.get();

// このスレッドにまだセッションがない場合は、新しいセッションを開きます

if (s == null) {

s = sessionFactory.openSession();

セッション.セット;

}

戻り値;

}



public static void closeSession() throws HibernateException {

セッション s = (セッション) session.get();

Session.set(null);

if (s != null)

s.close();

}

}



User.java のソース コードは次のとおりです。 Hibernate は、通常の Java オブジェクト (Plain Old Java Object、POJO、Plain Ordinary Java Object とも呼ばれる) を永続クラスに変換します。 POJO は JavaBean によく似ており、プロパティには getter メソッドと setter メソッドを通じてアクセスし、内部実装の詳細を外部から隠します。



パブリック クラス ユーザー {



    プライベート整数 ID;

    プライベート文字列ニックネーム;

    プライベート文字列パスワード ;

    プライベート文字列メール;



    public User() {

    }



    public Integer getId() {

        ID を返します;

    }



    public void setId(整数 ID) {

        this.id = id;

    }



    public String getNick() {

        ニックを返してください;

    }



    public void setNick(String ニック) {

        this.nick = ニック;

    }



    public String getPassword() {

        パスワードを返します;

    }



    public void setPassword(String パスワード) {

        this.password = パスワード;

    }



    public String getEmail() {

        メールを返信してください;

    }



    public void setEmail(String email) {

        this.email = メール;

    }



}



Test.java ソース代码如下:



import javax.naming.*;

net.sf.hibernate.*;
をインポートします
import java.util.*;



パブリッククラステスト{

  void テスト(){

   

  }

  public static void insert(){

    試してください{

      セッション hSession = HibernateUtil.currentSession();

      トランザクション tx= hSession.beginTransaction();

      

      ユーザー newp = new User();

      整数 ID = new Integer("4");

      newp.setId(id);

      newp.setNick("愛");

      newp.setPassword("123");

      newp.setEmail("test@sohu.com");

      

      hSession.save(newp);

      tx.commit();

      HibernateUtil.closeSession();

    }catch(例外 e){

      e.printStackTrace();

    }

  }

}





10. 编写Hibernate XML映射ファイル

在resin3 mydomainWEB-INFclasses目录下新建User.hbm.xml文件,文件内容如下:






    PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"

    「http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd」>



<休止状態マッピング>



  <クラス名="ユーザー" テーブル="ユーザー">

   

      <列名="user_id" sql-type="Integer" not-null="true"/>

      <ジェネレータークラス="割り当て済み"/>

   




    <プロパティ名="パスワード" タイプ="java.lang.String">

      <列名="パスワード" sql-type="varchar(20)"/>

   



    <プロパティ名="nick" type="java.lang.String">

      <列名="ニックネーム" sql-type="varchar(50)"/>

   



    <プロパティ名="email" type="java.lang.String">

<列名="e_mail" sql-type="varchar(30)"/>











簡単な説明:

要素の name 属性は User クラスのフルパス名 (つまり、パッケージ名 + クラス名の形式) を表し、table 属性はユーザー クラスのデータベース テーブル名のマッピング。

要素はテーブルの主キーを表し、name 属性は User クラスの対応するクラス属性名を表します。

要素は、id 属性に対応するデータベース ユーザー テーブルの user_id フィールドを表します。





11. インターフェーステスト:

次のように、resin3mydomain ディレクトリに新しい test.jsp ファイルを作成します。


<%@ page contentType="text/html; charset=gb2312" %>



<頭>

これはテストです! <br> </head><br> <br> <br> <br> これはテストです!<br> <br> <%Test.insert();%><br> <br> </body><br> <br> </html><br> <br> <br> <br> <br> <br> 12. テスト<br> <br> さて、準備がすべて完了したので、テストを開始しましょう。 <br> <br> Rensinサーバーを起動します。起動ファイルはresin3binhttpd.exeで、ファイルをダブルクリックします。 <br> <br> テスト前に確認したmysqlのuserテーブルの内容は以下の通りです。 <br> <br> User_id パスワード ニックネーム E_mail<br> 1 6666 ハマル hamal@sohu.com<br> 2 6666 吸血鬼吸血鬼@sina.com<br> 3 6666 アンデ ande@yahoo.com<br> <br> 次に、IE を開き、アドレス バーに http://localhost:8080/test.jsp<br> と入力します。 <br> This is a test! がインターフェースに正常に表示されたら、次のようにデータベースの内容を確認します。 <br> User_id パスワード ニックネーム E_mail<br> 1 6666 ハマル hamal@sohu.com<br> 2 6666 吸血鬼吸血鬼@sina.com<br> 3 6666 アンデ ande@yahoo.com<br> 4 123 愛 test@sohu.com<br> <br> <br> おめでとうございます。この例は完了しました。 <br> <br><br>http://www.bkjia.com/PHPjc/630945.html<p align="left"></p> <div style="display:none;">www.bkjia.com<span id="url" itemprop="url"></span>本当<span id="indexUrl" itemprop="indexUrl"></span>http://www.bkjia.com/PHPjc/630945.html<span id="isOriginal" itemprop="isOriginal"></span>技術記事<span id="isBasedOnUrl" itemprop="isBasedOnUrl"></span>樹脂 3.0 の mysql に接続するように hibernate2.1.2 を設定します。 樹脂 3.0 の mysql に接続するように hibernate2.1.2 を設定します。 作成者: hamal 規則: 樹脂 3 は、樹脂 3.0 のインストール ルート ディレクトリを表します。 <span id="genre" itemprop="genre"></span> </div></database> </div> </div> <div class="wzconShengming_sp"> <div class="bzsmdiv_sp">このウェブサイトの声明</div> <div>この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。</div> </div> </div> <ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5902227090019525" data-ad-slot="2507867629"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <div class="AI_ToolDetails_main4sR"> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5902227090019525" data-ad-slot="3653428331" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <!-- <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>人気の記事</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796780570.html" title="R.E.P.O.説明されたエネルギー結晶と彼らが何をするか(黄色のクリスタル)" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.説明されたエネルギー結晶と彼らが何をするか(黄色のクリスタル)</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796780641.html" title="R.E.P.O.最高のグラフィック設定" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.最高のグラフィック設定</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796785841.html" title="アサシンのクリードシャドウズ:シーシェルリドルソリューション" class="phpgenera_Details_mainR4_bottom_title">アサシンのクリードシャドウズ:シーシェルリドルソリューション</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>2週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796780520.html" title="R.E.P.O.誰も聞こえない場合はオーディオを修正する方法" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.誰も聞こえない場合はオーディオを修正する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796779766.html" title="WWE 2K25:Myriseのすべてのロックを解除する方法" class="phpgenera_Details_mainR4_bottom_title">WWE 2K25:Myriseのすべてのロックを解除する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>4週間前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/article.html">もっと見る</a> </div> </div> </div> --> <div class="phpgenera_Details_mainR3"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hottools2.png" alt="" /> <h2>ホットAIツール</h2> </div> <div class="phpgenera_Details_mainR3_bottom"> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411540686492.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undresser.AI Undress" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_title"> <h3>Undresser.AI Undress</h3> </a> <p>リアルなヌード写真を作成する AI 搭載アプリ</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411552797167.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Clothes Remover" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_title"> <h3>AI Clothes Remover</h3> </a> <p>写真から衣服を削除するオンライン AI ツール。</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173410641626608.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undress AI Tool" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_title"> <h3>Undress AI Tool</h3> </a> <p>脱衣画像を無料で</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411529149311.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Clothoff.io" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_title"> <h3>Clothoff.io</h3> </a> <p>AI衣類リムーバー</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/ai-hentai-generator" title="AI Hentai Generator" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173405034393877.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Hentai Generator" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/ai-hentai-generator" title="AI Hentai Generator" class="phpmain_tab2_mids_title"> <h3>AI Hentai Generator</h3> </a> <p>AIヘンタイを無料で生成します。</p> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/ai">もっと見る</a> </div> </div> </div> <script src="https://sw.php.cn/hezuo/cac1399ab368127f9b113b14eb3316d0.js" type="text/javascript"></script> <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>人気の記事</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796780570.html" title="R.E.P.O.説明されたエネルギー結晶と彼らが何をするか(黄色のクリスタル)" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.説明されたエネルギー結晶と彼らが何をするか(黄色のクリスタル)</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796780641.html" title="R.E.P.O.最高のグラフィック設定" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.最高のグラフィック設定</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796785841.html" title="アサシンのクリードシャドウズ:シーシェルリドルソリューション" class="phpgenera_Details_mainR4_bottom_title">アサシンのクリードシャドウズ:シーシェルリドルソリューション</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>2週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796780520.html" title="R.E.P.O.誰も聞こえない場合はオーディオを修正する方法" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.誰も聞こえない場合はオーディオを修正する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796779766.html" title="WWE 2K25:Myriseのすべてのロックを解除する方法" class="phpgenera_Details_mainR4_bottom_title">WWE 2K25:Myriseのすべてのロックを解除する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>4週間前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/article.html">もっと見る</a> </div> </div> </div> <div class="phpgenera_Details_mainR3"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hottools2.png" alt="" /> <h2>ホットツール</h2> </div> <div class="phpgenera_Details_mainR3_bottom"> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/92" title="メモ帳++7.3.1" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab96f0f39f7357.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="メモ帳++7.3.1" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/92" title="メモ帳++7.3.1" class="phpmain_tab2_mids_title"> <h3>メモ帳++7.3.1</h3> </a> <p>使いやすく無料のコードエディター</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/93" title="SublimeText3 中国語版" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97a3baad9677.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 中国語版" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/93" title="SublimeText3 中国語版" class="phpmain_tab2_mids_title"> <h3>SublimeText3 中国語版</h3> </a> <p>中国語版、とても使いやすい</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/121" title="ゼンドスタジオ 13.0.1" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97ecd1ab2670.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="ゼンドスタジオ 13.0.1" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/121" title="ゼンドスタジオ 13.0.1" class="phpmain_tab2_mids_title"> <h3>ゼンドスタジオ 13.0.1</h3> </a> <p>強力な PHP 統合開発環境</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/469" title="ドリームウィーバー CS6" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d0e0fc74683535.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="ドリームウィーバー CS6" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/469" title="ドリームウィーバー CS6" class="phpmain_tab2_mids_title"> <h3>ドリームウィーバー CS6</h3> </a> <p>ビジュアル Web 開発ツール</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/500" title="SublimeText3 Mac版" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d34035e2757995.png?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 Mac版" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/500" title="SublimeText3 Mac版" class="phpmain_tab2_mids_title"> <h3>SublimeText3 Mac版</h3> </a> <p>神レベルのコード編集ソフト(SublimeText3)</p> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/ai">もっと見る</a> </div> </div> </div> <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>ホットトピック</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/gmailyxdlrkzn" title="Gmailメールのログイン入り口はどこですか?" class="phpgenera_Details_mainR4_bottom_title">Gmailメールのログイン入り口はどこですか?</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>7486</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>15</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/cakephp-tutor" title="CakePHP チュートリアル" class="phpgenera_Details_mainR4_bottom_title">CakePHP チュートリアル</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>1377</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>52</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/steamdzhmcssmgs" title="Steamのアカウント名の形式は何ですか" class="phpgenera_Details_mainR4_bottom_title">Steamのアカウント名の形式は何ですか</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>77</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>11</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/winactivationkeyper" title="Win11 Activation Key Permanent" class="phpgenera_Details_mainR4_bottom_title">Win11 Activation Key Permanent</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>51</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>19</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/newyorktimesdailybrief" title="NYTの接続はヒントと回答です" class="phpgenera_Details_mainR4_bottom_title">NYTの接続はヒントと回答です</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>19</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>38</span> </div> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/faq/zt">もっと見る</a> </div> </div> </div> </div> </div> <div class="Article_Details_main2"> <div class="phpgenera_Details_mainL4"> <div class="phpmain1_2_top"> <a href="javascript:void(0);" class="phpmain1_2_top_title">Related knowledge<img src="/static/imghw/index2_title2.png" alt="" /></a> </div> <div class="phpgenera_Details_mainL4_info"> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796793114.html" title="MySQL:初心者向けのデータ管理の容易さ" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/001/253/068/174412844152652.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="MySQL:初心者向けのデータ管理の容易さ" /> </a> <a href="https://www.php.cn/ja/faq/1796793114.html" title="MySQL:初心者向けのデータ管理の容易さ" class="phphistorical_Version2_mids_title">MySQL:初心者向けのデータ管理の容易さ</a> <span class="Articlelist_txts_time">Apr 09, 2025 am 12:07 AM</span> <p class="Articlelist_txts_p">MySQLは、インストールが簡単で、強力で管理しやすいため、初心者に適しています。 1.さまざまなオペレーティングシステムに適した、単純なインストールと構成。 2。データベースとテーブルの作成、挿入、クエリ、更新、削除などの基本操作をサポートします。 3.参加オペレーションやサブクエリなどの高度な機能を提供します。 4.インデックス、クエリの最適化、テーブルパーティション化により、パフォーマンスを改善できます。 5。データのセキュリティと一貫性を確保するために、バックアップ、リカバリ、セキュリティ対策をサポートします。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796793044.html" title="NAVICATでデータベースパスワードを取得できますか?" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202412/25/2024122518131611619.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="NAVICATでデータベースパスワードを取得できますか?" /> </a> <a href="https://www.php.cn/ja/faq/1796793044.html" title="NAVICATでデータベースパスワードを取得できますか?" class="phphistorical_Version2_mids_title">NAVICATでデータベースパスワードを取得できますか?</a> <span class="Articlelist_txts_time">Apr 08, 2025 pm 09:51 PM</span> <p class="Articlelist_txts_p">NAVICAT自体はデータベースパスワードを保存せず、暗号化されたパスワードのみを取得できます。解決策:1。パスワードマネージャーを確認します。 2。NAVICATの「パスワードを記憶する」機能を確認します。 3.データベースパスワードをリセットします。 4.データベース管理者に連絡してください。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796793236.html" title="Navicatプレミアムの作成方法" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202406/04/2024060423512083021.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="Navicatプレミアムの作成方法" /> </a> <a href="https://www.php.cn/ja/faq/1796793236.html" title="Navicatプレミアムの作成方法" class="phphistorical_Version2_mids_title">Navicatプレミアムの作成方法</a> <span class="Articlelist_txts_time">Apr 09, 2025 am 07:09 AM</span> <p class="Articlelist_txts_p">NAVICATプレミアムを使用してデータベースを作成します。データベースサーバーに接続し、接続パラメーターを入力します。サーバーを右クリックして、[データベースの作成]を選択します。新しいデータベースの名前と指定された文字セットと照合を入力します。新しいデータベースに接続し、オブジェクトブラウザにテーブルを作成します。テーブルを右クリックして、データを挿入してデータを挿入します。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796793637.html" title="MySQL:簡単な学習のためのシンプルな概念" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/001/253/068/174424859118968.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="MySQL:簡単な学習のためのシンプルな概念" /> </a> <a href="https://www.php.cn/ja/faq/1796793637.html" title="MySQL:簡単な学習のためのシンプルな概念" class="phphistorical_Version2_mids_title">MySQL:簡単な学習のためのシンプルな概念</a> <span class="Articlelist_txts_time">Apr 10, 2025 am 09:29 AM</span> <p class="Articlelist_txts_p">MySQLは、オープンソースのリレーショナルデータベース管理システムです。 1)データベースとテーブルの作成:createdatabaseおよびcreateTableコマンドを使用します。 2)基本操作:挿入、更新、削除、選択。 3)高度な操作:参加、サブクエリ、トランザクション処理。 4)デバッグスキル:構文、データ型、およびアクセス許可を確認します。 5)最適化の提案:インデックスを使用し、選択*を避け、トランザクションを使用します。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796793033.html" title="MariadBのNAVICATでデータベースパスワードを表示する方法は?" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202412/30/2024123014481368572.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="MariadBのNAVICATでデータベースパスワードを表示する方法は?" /> </a> <a href="https://www.php.cn/ja/faq/1796793033.html" title="MariadBのNAVICATでデータベースパスワードを表示する方法は?" class="phphistorical_Version2_mids_title">MariadBのNAVICATでデータベースパスワードを表示する方法は?</a> <span class="Articlelist_txts_time">Apr 08, 2025 pm 09:18 PM</span> <p class="Articlelist_txts_p">Passwordが暗号化された形式で保存されているため、MariadbのNavicatはデータベースパスワードを直接表示できません。データベースのセキュリティを確保するには、パスワードをリセットするには3つの方法があります。NAVICATを介してパスワードをリセットし、複雑なパスワードを設定します。構成ファイルを表示します(推奨されていない、高リスク)。システムコマンドラインツールを使用します(推奨されません。コマンドラインツールに習熟する必要があります)。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796793085.html" title="NAVICATでSQLを実行する方法" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202406/13/2024061317003262370.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="NAVICATでSQLを実行する方法" /> </a> <a href="https://www.php.cn/ja/faq/1796793085.html" title="NAVICATでSQLを実行する方法" class="phphistorical_Version2_mids_title">NAVICATでSQLを実行する方法</a> <span class="Articlelist_txts_time">Apr 08, 2025 pm 11:42 PM</span> <p class="Articlelist_txts_p">NAVICATでSQLを実行する手順:データベースに接続します。 SQLエディターウィンドウを作成します。 SQLクエリまたはスクリプトを書きます。 [実行]ボタンをクリックして、クエリまたはスクリプトを実行します。結果を表示します(クエリが実行された場合)。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796793240.html" title="NavicatでMySQLへの新しい接続を作成する方法" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202406/04/2024060423392415044.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="NavicatでMySQLへの新しい接続を作成する方法" /> </a> <a href="https://www.php.cn/ja/faq/1796793240.html" title="NavicatでMySQLへの新しい接続を作成する方法" class="phphistorical_Version2_mids_title">NavicatでMySQLへの新しい接続を作成する方法</a> <span class="Articlelist_txts_time">Apr 09, 2025 am 07:21 AM</span> <p class="Articlelist_txts_p">手順に従って、NAVICATで新しいMySQL接続を作成できます。アプリケーションを開き、新しい接続(CTRL N)を選択します。接続タイプとして「mysql」を選択します。ホスト名/IPアドレス、ポート、ユーザー名、およびパスワードを入力します。 (オプション)Advanced Optionsを構成します。接続を保存して、接続名を入力します。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796793641.html" title="MySQLおよびSQL:開発者にとって不可欠なスキル" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/001/253/068/174424864129442.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="MySQLおよびSQL:開発者にとって不可欠なスキル" /> </a> <a href="https://www.php.cn/ja/faq/1796793641.html" title="MySQLおよびSQL:開発者にとって不可欠なスキル" class="phphistorical_Version2_mids_title">MySQLおよびSQL:開発者にとって不可欠なスキル</a> <span class="Articlelist_txts_time">Apr 10, 2025 am 09:30 AM</span> <p class="Articlelist_txts_p">MySQLとSQLは、開発者にとって不可欠なスキルです。 1.MYSQLはオープンソースのリレーショナルデータベース管理システムであり、SQLはデータベースの管理と操作に使用される標準言語です。 2.MYSQLは、効率的なデータストレージと検索機能を介して複数のストレージエンジンをサポートし、SQLは簡単なステートメントを通じて複雑なデータ操作を完了します。 3.使用の例には、条件によるフィルタリングやソートなどの基本的なクエリと高度なクエリが含まれます。 4.一般的なエラーには、SQLステートメントをチェックして説明コマンドを使用することで最適化できる構文エラーとパフォーマンスの問題が含まれます。 5.パフォーマンス最適化手法には、インデックスの使用、フルテーブルスキャンの回避、参加操作の最適化、コードの読み取り可能性の向上が含まれます。</p> </div> </div> <a href="https://www.php.cn/ja/be/" class="phpgenera_Details_mainL4_botton"> <span>See all articles</span> <img src="/static/imghw/down_right.png" alt="" /> </a> </div> </div> </div> </main> <footer> <div class="footer"> <div class="footertop"> <img src="/static/imghw/logo.png" alt=""> <p>福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!</p> </div> <div class="footermid"> <a href="https://www.php.cn/ja/about/us.html">私たちについて</a> <a href="https://www.php.cn/ja/about/disclaimer.html">免責事項</a> <a href="https://www.php.cn/ja/update/article_0_1.html">Sitemap</a> </div> <div class="footerbottom"> <p> © php.cn All rights reserved </p> </div> </div> </footer> <input type="hidden" id="verifycode" value="/captcha.html"> <script>layui.use(['element', 'carousel'], function () {var element = layui.element;$ = layui.jquery;var carousel = layui.carousel;carousel.render({elem: '#test1', width: '100%', height: '330px', arrow: 'always'});$.getScript('/static/js/jquery.lazyload.min.js', function () {$("img").lazyload({placeholder: "/static/images/load.jpg", effect: "fadeIn", threshold: 200, skip_invisible: false});});});</script> <script src="/static/js/common_new.js"></script> <script type="text/javascript" src="/static/js/jquery.cookie.js?1744528730"></script> <script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script> <link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css?2' type='text/css' media='all' /> <script type='text/javascript' src='/static/js/viewer.min.js?1'></script> <script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script> <script type="text/javascript" src="/static/js/global.min.js?5.5.53"></script> <script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function () { var u = "https://tongji.php.cn/"; _paq.push(['setTrackerUrl', u + 'matomo.php']); _paq.push(['setSiteId', '9']); var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0]; g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s); })(); </script> <script> // top layui.use(function () { var util = layui.util; util.fixbar({ on: { mouseenter: function (type) { layer.tips(type, this, { tips: 4, fixed: true, }); }, mouseleave: function (type) { layer.closeAll("tips"); }, }, }); }); document.addEventListener("DOMContentLoaded", (event) => { // 定义一个函数来处理滚动链接的点击事件 function setupScrollLink(scrollLinkId, targetElementId) { const scrollLink = document.getElementById(scrollLinkId); const targetElement = document.getElementById(targetElementId); if (scrollLink && targetElement) { scrollLink.addEventListener("click", (e) => { e.preventDefault(); // 阻止默认链接行为 targetElement.scrollIntoView({ behavior: "smooth" }); // 平滑滚动到目标元素 }); } else { console.warn( `Either scroll link with ID '${scrollLinkId}' or target element with ID '${targetElementId}' not found.` ); } } // 使用该函数设置多个滚动链接 setupScrollLink("Article_Details_main1L2s_1", "article_main_title1"); setupScrollLink("Article_Details_main1L2s_2", "article_main_title2"); setupScrollLink("Article_Details_main1L2s_3", "article_main_title3"); setupScrollLink("Article_Details_main1L2s_4", "article_main_title4"); setupScrollLink("Article_Details_main1L2s_5", "article_main_title5"); setupScrollLink("Article_Details_main1L2s_6", "article_main_title6"); // 可以继续添加更多的滚动链接设置 }); window.addEventListener("scroll", function () { var fixedElement = document.getElementById("Article_Details_main1Lmain"); var scrollTop = window.scrollY || document.documentElement.scrollTop; // 兼容不同浏览器 var clientHeight = window.innerHeight || document.documentElement.clientHeight; // 视口高度 var scrollHeight = document.documentElement.scrollHeight; // 页面总高度 // 计算距离底部的距离 var distanceToBottom = scrollHeight - scrollTop - clientHeight; // 当距离底部小于或等于300px时,取消固定定位 if (distanceToBottom <= 980) { fixedElement.classList.remove("Article_Details_main1Lmain"); fixedElement.classList.add("Article_Details_main1Lmain_relative"); } else { // 否则,保持固定定位 fixedElement.classList.remove("Article_Details_main1Lmain_relative"); fixedElement.classList.add("Article_Details_main1Lmain"); } }); </script> </body> </html>