MySQL データベースで CRUD を実行する Java プログラムがあります。
このために、私は使用していました:
Eclipse Indigo
Java 1.6
MySql-Connector-java-5.1.19-bin.jar
新しいマシンで
同じコードを実行しようとしました:
Eclipse Juno
Java 1.7
MySql-Connector-java-5.1.19-bin.jar.
Eclipse Juno のプロジェクトのビルド パスに MySql コネクタを追加しました。
ただし、ant ビルドは、コネクタから取得する必要がある欠落しているクラスとパッケージに関するエラーで失敗します。
Buildfile: /home/rudra/Softwares/openfire/openfire_src/build/build.xml
init:
compile:
[javac] Compiling 14 source files to /home/rudra/Softwares/openfire/openfire_src/work/classes
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.5
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:3: error: package com.mysql.jdbc does not exist
[javac] import com.mysql.jdbc.Connection;
[javac] ^
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:4: error: package com.mysql.jdbc does not exist
[javac] import com.mysql.jdbc.PreparedStatement;
[javac] ^
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:5: error: package com.mysql.jdbc does not exist
[javac] import com.mysql.jdbc.ResultSet;
[javac] ^
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:21: error: cannot find symbol
[javac] PreparedStatement stat = (PreparedStatement)connect.prepareStatement(query2);
[javac] ^
[javac] symbol: class PreparedStatement
[javac] location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:21: error: cannot find symbol
[javac] PreparedStatement stat = (PreparedStatement)connect.prepareStatement(query2);
[javac] ^
[javac] symbol: class PreparedStatement
[javac] location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:21: error: cannot find symbol
[javac] PreparedStatement stat = (PreparedStatement)connect.prepareStatement(query2);
[javac] ^
[javac] symbol: method prepareStatement(String)
[javac] location: variable connect of type Connection
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:23: error: cannot find symbol
[javac] ResultSet result = (ResultSet) stat.executeQuery();
[javac] ^
[javac] symbol: class ResultSet
[javac] location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:23: error: cannot find symbol
[javac] ResultSet result = (ResultSet) stat.executeQuery();
[javac] ^
[javac] symbol: class ResultSet
[javac] location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:28: error: cannot find symbol
[javac] PreparedStatement preparedStmt = (PreparedStatement) connect.prepareStatement(query);
[javac] ^
[javac] symbol: class PreparedStatement
[javac] location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:28: error: cannot find symbol
[javac] PreparedStatement preparedStmt = (PreparedStatement) connect.prepareStatement(query);
[javac] ^
[javac] symbol: class PreparedStatement
[javac] location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:28: error: cannot find symbol
[javac] PreparedStatement preparedStmt = (PreparedStatement) connect.prepareStatement(query);
[javac] ^
[javac] symbol: method prepareStatement(String)
[javac] location: variable connect of type Connection
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:41: error: cannot find symbol
[javac] PreparedStatement statement = (PreparedStatement) connect.prepareStatement("Insert into user values (?,?,?);");
[javac] ^
[javac] symbol: class PreparedStatement
[javac] location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:41: error: cannot find symbol
[javac] PreparedStatement statement = (PreparedStatement) connect.prepareStatement("Insert into user values (?,?,?);");
[javac] ^
[javac] symbol: class PreparedStatement
[javac] location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:41: error: cannot find symbol
[javac] PreparedStatement statement = (PreparedStatement) connect.prepareStatement("Insert into user values (?,?,?);");
[javac] ^
[javac] symbol: method prepareStatement(String)
[javac] location: variable connect of type Connection
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:73: error: cannot find symbol
[javac] PreparedStatement statement = (PreparedStatement) connect.prepareStatement(query);
[javac] ^
[javac] symbol: class PreparedStatement
[javac] location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:73: error: cannot find symbol
[javac] PreparedStatement statement = (PreparedStatement) connect.prepareStatement(query);
[javac] ^
[javac] symbol: class PreparedStatement
[javac] location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:73: error: cannot find symbol
[javac] PreparedStatement statement = (PreparedStatement) connect.prepareStatement(query);
[javac] ^
[javac] symbol: method prepareStatement(String)
[javac] location: variable connect of type Connection
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:75: error: cannot find symbol
[javac] ResultSet result = (ResultSet) statement.executeQuery();
[javac] ^
[javac] symbol: class ResultSet
[javac] location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:75: error: cannot find symbol
[javac] ResultSet result = (ResultSet) statement.executeQuery();
[javac] ^
[javac] symbol: class ResultSet
[javac] location: class UserDB
誰でもこれで私を助けることができますか?