[JBoss-user] [JNDI/Naming/Network] - ClassCastException at $Proxy2.getTables()

2005-09-06 Thread asinezhang
I've configed JBoss Connection Pool and the database is Oracle9i. 
But I met some error when I use getTables() method,there was an error. The code 
is as followed: 

Hashtable env = new Hashtable(); 
env.put(Context.INITIAL_CONTEXT_FACTORY, 
"org.jnp.interfaces.NamingContextFactory"); 
env.put(Context.PROVIDER_URL, "localhost:1099"); 
InitialContext ctx = new InitialContext(env); 
DataSource ds = (DataSource) ctx.lookup("OracleDS"); 
try { 
Connection conn = ds.getConnection(); 
DatabaseMetaData dm = conn.getMetaData(); 

System.out.println(dm.getDriverName()); 
System.out.println(dm.getDriverVersion()); 
System.out.println(dm.usesLocalFiles()); 
Object o= dm.getTables(null, null, "%", null); 

conn.close(); 
} catch (SQLException e1) { 
e1.printStackTrace(); 
} 
} catch (NamingException e) { 
e.printStackTrace(); 
} 
The error message was: 
java.lang.ClassCastException 
at $Proxy2.getTables(Unknown Source) 
at testH.main(testH.java:43) 
Exception in thread "main" 

I'm confused, anyone can help me? Thanks in advance!
JBoss 4.0.1sp1, Oracle9i

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3893151#3893151

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3893151


---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Getting Started Documentation] - JBoss Connection Pool & Oracle problem:getTables()

2005-09-06 Thread asinezhang
I've configed JBoss Connection Pool and the database is Oracle9i.
But I met some error when I use getTables() method,there was an error. The 
code is as follow:

 Hashtable env = new Hashtable();
 env.put(Context.INITIAL_CONTEXT_FACTORY, 
"org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "localhost:1099");
InitialContext ctx = new InitialContext(env);
DataSource ds = (DataSource) ctx.lookup("OracleDS");
try {
Connection conn = ds.getConnection(); 
DatabaseMetaData  dm = conn.getMetaData();

System.out.println(dm.getDriverName());
System.out.println(dm.getDriverVersion());
System.out.println(dm.usesLocalFiles());
Object o= dm.getTables(null, null, "%", null);

conn.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
} catch (NamingException e) {
e.printStackTrace();
} 

The error message was:
java.lang.ClassCastException
at $Proxy2.getTables(Unknown Source)
at testH.main(testH.java:43)
Exception in thread "main"
  I'm confused, anyone can help me? thanks in advance!

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3893149#3893149

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3893149


---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user