oracle.i18n.text.converter.CharacterConverterOGS.getInstance(I) Exception
695626Apr 9 2009 — edited Oct 21 2010Hello,
I am trying to access Oracle 11g using Java 6 on Windows XP SP3.
Here is the code that I have tried accessing with -
public Connection returnNewDBConnection() {
Connection connection = null;
try {
// Load the JDBC driver
OracleDataSource ods = new OracleDataSource();
// Create a connection to the database
String serverName = "localhost";
String portNumber = "1521";
String sid = "testdb";
String url = "jdbc:oracle:thin:testoracleuser/testoracleuser@" + serverName + ":" + portNumber + ":" + sid;
String username = "testoracleuser";
String password = "testoracleuser";
ods.setURL(url);
connection = ods.getConnection();
} catch (Exception e) {
// Could not find the database driver
e.printStackTrace();
}
return connection;
}
The above code raises the exception as below -
Exception in thread "main" java.lang.NoSuchMethodError: oracle.i18n.text.converter.CharacterConverterOGS.getInstance(I)Loracle/i18n/text/converter/CharacterConverter;
at oracle.sql.converter.CharacterConverterFactoryOGS.make(CharacterConverterFactoryOGS.java:43)
at oracle.sql.CharacterSetWithConverter.getInstance(CharacterSetWithConverter.java:95)
at oracle.sql.CharacterSetFactoryThin.make(CharacterSetFactoryThin.java:126)
at oracle.sql.CharacterSet.make(CharacterSet.java:447)
at oracle.jdbc.driver.DBConversion.init(DBConversion.java:150)
at oracle.jdbc.driver.DBConversion.<init>(DBConversion.java:111)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1008)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:291)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:490)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:202)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:465)
at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:275)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:206)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:156)
at client.DBConnection.returnNewDBConnection(DBConnection.java:27)
at client.CSVOperations.main(CSVOperations.java:43)
Searching online for the similar posts about this exception, i could only find problems dealing with ororai18n.jar not included in the build path. I am using Eclipse IDE and I have included orai18n.jar, ojdbc6.jar files already but still no dice.
Please help.