Hi Richard,

Thanks for the quick suggestion. I tried the following

wsadmin>from oracle.jdbc  import Oracle
WASX7015E: Exception running command: "from oracle.jdbc  import Oracle"; exception information:
 com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
  File "<input>", line 1, in ?
ImportError: No module named jdbc

wsadmin>


But the same error, I guess.

Regards,
Debabrata Pani


On Fri, May 9, 2014 at 12:04 PM, Richard Eckart de Castilho <richard.eckart@gmail.com> wrote:
Hi,

it should work if you say

from oracle.jdbc import OracleDriver

Cheers,

-- Richard

On 09.05.2014, at 08:00, Debabrata Pani <debabrata.pani@gmail.com> wrote:

> Hi ,
>
> I have Websphere wsadmin setup which enables jython scripting.
>
> The jython version is :
>
> wsadmin>sys.version
> '2.1'
> wsadmin>
>
>
> In the wsadmin prompt, when I type the following :
>
> wsadmin> import oracle.jdbc.OracleDriver
>
> I get
>
> WASX7015E: Exception running command: "import oracle.jdbc.OracleDriver"; exception information:
>  com.ibm.bsf.BSFException: exception from Jython:
> Traceback (innermost last):
>   File "<input>", line 1, in ?
> ImportError: No module named jdbc
>
>
> But when i do the following :
>
> wsadmin>tt = java.lang.Class.forName('oracle.jdbc.OracleDriver')
>
> It goes through. Additionally,
>
> wsadmin>tt.getProtectionDomain()
> ProtectionDomain
> CodeSource=CodeSource, url=file:/some/path/work/middleware/wlserver_10.3/server/lib/ojdbc6.jar, <no certificates>
> ClassLoader=com.ibm.ws.bootstrap.ExtClassLoader@79ea79ea
> <no principals>
> Permissions:
>                 static: java.security.Permissions@25412541 (
>  (java.io.FilePermission /some/path/work/middleware/wlserver_10.3/server/lib/ojdbc6.jar read)
> )
>
>                 <no dynamic permissions>
>
> wsadmin>
>
>
> Can somebody explain what can be the possible reason for this discrepancy ? I tried understanding  the  jython "classpath" mechanism and how it depends upon sys.path and java.class.path . But I was unable to explain this particular behavior.
>
>
> Regards,
> Debabrata Pani