aspose file tools*
The moose likes Groovy and the fly likes Character Set Unknown issue using datasource in JBOSS server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Character Set Unknown issue using datasource in JBOSS server" Watch "Character Set Unknown issue using datasource in JBOSS server" New topic
Author

Character Set Unknown issue using datasource in JBOSS server

Ashwini Vailaya
Greenhorn

Joined: Feb 15, 2010
Posts: 2
Hi,

I am not able to read String data from SQLInput stream of a customized database object.

Java object corresponding to customized row type is:

public class Excust implements SQLData {
public String numFact;
public String indFact;
public String dFacEmi;
public int mntImp;
public String devTit;

private static String SCHEMA_NAME_POSTFIX = ".EXOBJECT";

public Excust () {
initSchemaName();
}
private void initSchemaName() {
String schemaname = "OPSSCHEMANAME";
sql_type = schemaname;
}
public void readSQL(SQLInput stream, String type) throws SQLException {
sql_type = type;
numFact = stream.readString(); //It is read as ???-- Character Set Unknown
indFact = stream.readString(); //It is read as ???-- Character Set Unknown
dFacEmi = stream.readString(); //It is read as ???-- Character Set Unknown
mntImp = stream.readInt();
devTit = stream.readString(); //It is read as ???-- Character Set Unknown

}

public void writeSQL(SQLOutput stream) throws SQLException {

// champs à écrire dans l'ordre
stream.writeString(numFact.toString());
stream.writeString(indFact.toString());
stream.writeString(dFacEmi.toString());
stream.writeInt(mntImp);
stream.writeString(devTit.toString());
}

When I get the connection object using DriverManager i.e.
Class.forName("oracle.jdbc.driver.OracleDriver");
connection = DriverManager.getConnection(
"jdbcracle:thin:@21.78.233.76:1521atabasename", "username",
"password");
I am able to get the data.

But using datasource in JBOSS I am not able to get the data saying "Character Set unknown".
Datasource code:

Context initContext = (Context) new InitialContext().
lookup("java:comp/env");
Hashtable params = new Hashtable();
params.put(Context.INITIAL_CONTEXT_FACTORY, org.jnp.interfaces.NamingContextFactory);
String providerURL = "21.78.233.76:1521";
params.put(Context.PROVIDER_URL, providerURL);
initContext = new InitialContext(params);
datasource = (DataSource) initContext.lookup("java:OracleDS");
initContext.close();
Connection connection = datasource.getConnection();

Our database is using WE8ISO8859P15 character set.

Can anybody please suggest why I am not able to get the data when I connect with datasource in JBOSS Server?

Thanks in advance.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Character Set Unknown issue using datasource in JBOSS server