cannot find symbol error
803541Oct 6 2010 — edited Oct 6 2010I am "hacking" together a program to read information from a database and I wanted to store the password encrypted in the properties file. I found Jasypt and was trying to implement it. It seems pretty straight forward, but due to my limited java knowledge I am running into problems. The code is as follows:
import freemarker.template.*;
import java.io.*;
import java.util.*;
import java.sql.*;
import oracle.jdbc.OracleConnection;
import org.jasypt.properties.EncryptableProperties;
REMOVED IRRELEVANT CODE
/**
* Read the properties file for the database connection information and
* for the SQL to execute.
*/
private static boolean readPropertiesFile() {
// Try to open the properties file
try {
//Create the encryptor
StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
encryptor.setPassword("jasypt");
// Find and open the properties file
Properties psExportProperties = new EncryptableProperties(encryptor);
FileInputStream psExportPropertiesFile = new FileInputStream("PowerSchoolExport.properties");
psExportProperties.load(psExportPropertiesFile);
// Read the properties file
connectionURL = psExportProperties.getProperty("connectionURL").trim();
if (userID == null) userID = psExportProperties.getProperty("userID").trim();
if (password == null) password = psExportProperties.getProperty("password").trim();
sqlFilename = psExportProperties.getProperty("sqlFilename").trim();
exportFilename = psExportProperties.getProperty("exportFilename").trim();
templateFilename = psExportProperties.getProperty("templateFilename").trim();
// Close the properties file
psExportPropertiesFile.close();
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}
REMOVED IRRELEVANT CODE
}
The error I get is this:
PowerSchoolTemplateExport.java:85: cannot find symbol
symbol : class StandardPBEStringEncryptor
location: class PowerSchoolTemplateExport
StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
I think it is because I have not included all the required code. Any help would be greatly appreciated.
Thanks