Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

cannot find symbol error

803541Oct 6 2010 — edited Oct 6 2010
I 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 3 2010
Added on Oct 6 2010
3 comments
505 views