Problem using JDBC driver with JSP

Hi, I am trying to connecto to my mysql server via a JSP page, but it seems that there is a problem with the driver call or something in my configuration that unables me to connect. I have the mysql-connector-java-3.0.7-stable driver.
This is how my classpath looks like:
CLASSPATH=/home/hooper/Sources/mysql-connector-java-4.0.7-stable/lib:/home/hooper/Sources/mysql-connector-java-3.0.7-stable/com:/home/hooper/Sources/mysql-connector-java-3.0.7-stable/mysql-connector-java-3.0.7-stable-bin.jar:/usr/java/j2sdk1.4.1_02:.:/usr/java/j2sdk1.4.1_02/lib/tools.jar:/usr/java/j2sdk1.4.1_02
And this is my JSP page code:
<%@ page language="java" import= "java.sql.*"%>
<%
Connection con = null;
     String userName = "hooper";
     String password = ""; //No password
     String url = "jdbc:mysql://localhost/test";
     //Load the Driver class file
     Class.forName("com.mysql.jdbc.Driver");
     //Make a connection to the MySQL database
     con = DriverManager.getConnection (url, userName, password);
     out.println ("Database connection established");
          if (con != null){
               //Close the connection
               con.close();
%>
And this is the error I get from Tomcat4.1.18:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: com.mysql.jdbc.Driver
root cause
javax.servlet.ServletException: com.mysql.jdbc.Driver
I hope someone can help me with this.
Thanks,
Luis

Hi..
Try using this way
String userName = "hooper";
String password = ""; //No password
String url = "jdbc:mysql://localhost:3306/test";
Class.forName("org.gjt.mm.mysql.Driver");
try to download the driver for mysql and add it to your classpath
Hope this works
Regd
Vasi

Similar Messages

  • Home Hub 3 - problems using network drive with OS ...

    Hi , 
    I have recently switched back to BT and received the HH3 , all wifi connectivity is good . However , I am having problems connecting to the external hard drive I have plugged into it . We have to macbook pros in the household one running Leopard and mine which unfortunately ( it seems ) is running Lion.
    The MBP running leopard can see and connect to the network drive (1tb Seagate Expansion Drive FAT32)perfectly. However I am having problems doing the same via Lion . The HH3 is visible in Finder under shared and the usb_disk folder is visible , however when I click on it to access the external hard drive I am presented with this error :
    As I said the MBP running Leopard has no issues and connects perfectly :
    I have checked the HH3 which is running the latest firmware and checked to see if there was any firmware update to the Seagate , which the isn't !!
    ANY advice or suggestions would be greatly appreciated  

    Ah! that might be the problem, something residual, I did have a machine dual boot W7 and Ubuntu, now it just runs Unbuntu, but I decided to do a clean install.
    I dont think the macs have a problem with HH3, yes I picked that post about dual booting, interesting cos the obvious thing to do would be apply different static ip addresses to each O/S, that way the Hub sees them as static addresses for 2 machines, rather than setting them as dynamic by selecting always use the same ip address.
    Anyway there's a recent post on here regarding printers and Lion which got resolved, but again I looked at that from a windows pint of view.
    I've googled a couple of links which you have probably already found, https://discussions.apple.com/thread/3213886?start=0&tstart=0 https://discussions.apple.com/thread/3213886?start=0&tstart=0 the second one I know relates to ntfs external drives, but what I'm looking at is the solution using sudo mount and the various switches used.
    But you may just have to bite the bullet and do a clean install.

  • Problem using eSATA drive with my G5

    I recently bought an eSATA card for my G5, hoping that it would speed up my backups and other transfers of large quantities of data. The card is a FirmTek SeriTek/1VE4 PCI-X. The drive I am using is a Seagate Freeagent Pro 750gb.
    The drive works perfectly when used with either the USB or Firewire connections. But when I tried to hook up via the eSATA cable I got this message - "SeriTek/1VE4 in slot 2: configuration changed. Finalize all changes (connecting/removing devices) before closing this window". I then have the option of clicking on "Done - Show More Details" or "Done". Clicking on either simply causes the message to reappear.
    Unfortunately I have no idea what this means, and what I need to do. The drive is not showing on my screen when hooked up via eSATA; all that happens is the message above appearing on the screen. I have to disconnect the drive to get the message to go away.
    While I suspect (and hope!) this problem has an easy resolution I have no clue what to do at this point. Any help will be greatly appreciated!

    You checked first that the card is okay with those consumer style dual/quad interface cases?
    Sonnet cards specifically warn against.
    Your best bet is always to avoid vendor name brand drive cases for external drives.
    Go get yourself a plain simple dual SATA only case that doesn't have USB/eSATA (or USB/FW/eSATA).
    http://eshop.macsales.com/item/Other%20World%20Computing/MESATATBEK/
    FirmTek's own dual drive hot-swap
    http://eshop.macsales.com/item/Firmtek/SATA2EN2/
    FirmTek 5PM
    http://eshop.macsales.com/item/Firmtek/SATA5PM/

  • Problem using external drive with hdiutil

    Hello,
    I use hdiutil to produce CDR masters for our educational software. Works great if I only use my built in CD-RW/DVD-ROM drive on my 15" AL PowerBook. But it won't recognize my external LaCie 1394 CDRW firewire 400 drive. The -anydevice option has no effect. But if I insert a blank CDR, the Finder recognizes it and asks what to do. I've tried the -device option with the device name and still no joy. This is on 10.3.9, so I repeated the tests on 10.4.6 with no luck. The 10.4 Finder also regnizes the device. I've tried hdiutil burn -list and the firewire drive shows up as DRDeviceSupportLevelAppleSupported.
    Any ideas?
    Cole

    It seems you need to include "IOService:" in front of the OF path.
    On my iMac (10.4):
    imac$ hdiutil burn -list
    PIONEER DVD-RW DVR-K06 via ATAPI (DRDeviceSupportLevelAppleShipping)
    IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/PATA@1F,1/AppleIntelPIIX ATARoot/PRID@0/AppleIntelPIIXPATA/ATADeviceNub@0/IOATAPIProtocolTransport/IOSCSI PeripheralDeviceNub/IOSCSIPeripheralDeviceType05/IODVDServices
    and the following seems to work:
    imac$ hdiutil burn test.dmg -device IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/PATA@1F,1/AppleIntelPIIX ATARoot/PRID@0/AppleIntelPIIXPATA/ATADeviceNub@0/IOATAPIProtocolTransport/IOSCSI PeripheralDeviceNub/IOSCSIPeripheralDeviceType05/IODVDServices -sizequery
    On 10.3 you may need to add "-anydrive" option.

  • Help me! can not using JDBC driver for MS SQL server

    I can test sucess in connection, but create EJB when have follow error.
    04/05/19 12:23:04 SQL error: No suitable driver
    04/05/19 12:23:10 Error creating table: No suitable driver
    500 Internal Server Error
    java.lang.NoClassDefFoundError: oracle/jbo/html/HtmlServices
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:182)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)

    HI All,
    I am using JDBC driver to pull data from MS SQL Server
    2000 for my application Liaison Content Exchange, and
    which only accepts JDBC drivers to talk to databases.
    I dowloaded the driver from Microsoft website, and had
    a successful installation.What do you call "a successful installation"? Where was the JAR file places?
    But the application ask me for Driver Name, Class, URL, Time out and Data Source.What application do you mean? Liaison Content Exchange? I'm not familiar with that product.
    By default no driver is available in the drop down combo box. After using
    "com.microsoft.jdbcx.sqlserver.SQLServerDataSource" as
    class and
    jdbc:microsoft:sqlserver://192.168.17.2:1433; as url,
    the application throw me a error which states "Unable
    to instantiate an instance of the application driver"Sounds like it could be one of several things:
    (1) The JDBC JAR is not in the CLASSPATH where Liaison Content Exchange expects to find it.
    (2) You need to do something else to tell Liaison Content Exchange more information to define the data source.
    (3) The URL might be incorrect. Only you can know if the IP address of the host is correct. You don't supply a database name - perhaps you should. Are you sure that 1433 is the correct port number? I know that's true for SQL Server 7.0, but I remember that the default was changed to something else for SQL Server 2000. Ask your database admin what port this listener is assigned to for SQL Server 2000.
    (4) You might want to append ";selectmethod=cursor" to the end of your URL. (See the docs for this.)
    (5) Make sure you can connect to the database with something other than Java (e.g., the M$ SQL Server client).
    . I am not able to trouble shoot this problem, any one
    pls help me ASAP at [email protected]
    Thx.Bad idea to post an e-mail address. You're not supposed to communicate outside the forum. it's against the guidelines for using the forum.

  • Using java bean with jsp

    hello friends,
    i'm new to jsp. i want to create an html form that accepts username and a value from four radio buttons and display back the entered name and checked radio button's value using java bean.
    i use the <jsp:setProperty id="" property="*"> method. i don't know how to access the radio buttons value from the html.
    also when i use an additional field other than username the jsp page is showing error.
    Please give me the correct method to use java bean with jsp in this circumstance.
    thank you.

    thank you, but i have a problem left. the case is like this.
    i got the jsp and bean worked fine when i have a sinle input text field.
    but when i added a second text field i recieved the following error.
    javax.servlet.ServletException: basket.newbean.getUserPass()Ljava/lang/String;
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
         org.apache.jsp.newform.process_jsp._jspService(process_jsp.java:69)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    where userPass is the new form element. I have made the subsequent chanes in my bean program and jsp file.
    pls hlp.

  • Urg:Executing SQL From Java App using Jdbc Driver

    Hi
    I am using JDBC Driver version 9.0.1.1.0.
    I am running this in Thin Client Mode
    My Code Snippet Looks Like This:=
    ==========================================================
    String url = "jdbc:oracle:thin:@localhost:1521:VpDb";
    String userName = "scott";
    String password = "tiger";
    Connection conn = null ;
    Statement st = null ;
    ResultSet rs = null ;
    String categoryCode="ABC";
    try
    conn = DriverManager.getConnection (url, userName, password);
    st = conn.createStatement ();
    String sqlStatement = "Select Count(*) From News Where CategoryCode=" +"\'" + categoryCode + "\'" + ";";
    System.out.println(sqlStatement);
    rs = st.executeQuery ( sqlStatement );
    if( rs.next() )
    System.out.println("Headline Exists");
    else
    System.out.println("No Headline Exists");
    catch (SQLException e )
    System.out.println();
    System.out.println (" SQL ERROR IN IS_NEWS_EMPTY: " + e) ;
    =========================================================
    I have added the classes12.zip and nls_charset12.zip in the classpath.
    Now when i run this it gives me an error saying the following error message:-
    SQL ERROR IN IS_NEWS_EMPTY: java.sql.SQLException: ORA-00911: invalid character
    Can anyone help me with this as to whats going wrong because the exact equivalent of my sqlStamenet runs on SQL command line but not from java code.Why??
    Any Help appreciated
    Thanks
    Mum

    I think it is complaining about the ";" that you add at the end of your string. You don't need to add that to the query.

  • Problems using GET method in JSP

    Hi,
    I had some problems using GET method in JSP.
    I'm using Apache web server 1.3 and Tomcat 3.3.1 in windows 2000.
    And I'm using language English and Korean.
    When I send messages using POST method, all is good
    But when I send message using GET method, English is good, but Korean is not good.
    I tried to encode using
    URLEncode.encode(str, "UTF-8")
    and decoding it using
    URLDecode.decode(request.getParameter(tag), "UTF-8")
    but it didn't work.
    How can I receive request including Korean using GET method in JSP?
    If anyone have solutions, please let me know.
    thanks.

    Hi,
    I had some problems using GET method in JSP.
    I'm using Apache web server 1.3 and Tomcat 3.3.1 in
    windows 2000.
    And I'm using language English and Korean.
    When I send messages using POST method, all is good
    But when I send message using GET method, English is
    good, but Korean is not good.
    I tried to encode using
    URLEncode.encode(str, "UTF-8")
    and decoding it using
    URLDecode.decode(request.getParameter(tag), "UTF-8")
    but it didn't work.
    How can I receive request including Korean using GET
    method in JSP?
    If anyone have solutions, please let me know.
    thanks.This problem appears, when one use UTF-16 encoding in JSP - am I right?
    If so there are two solutions:
    1) Temporary: Use "UTF-8" - or any other 8 bit encoding scheme and
    encode Korean symbols with "&1234;" kind of escapes - though it
    may not work
    2) Absolute: get my piece of code, which I have managed to write
    just a month ago resolving absolutely similar problem with UTF-16
    in code using Chinese/Russian/English encodings
    But I wouldn't say that it's costs 10 DDs :) - it's much more
    expensive... So try 1st variant if it wouldn't help - let me know.
    I'll figure :)
    Paul

  • Where to find the useful jdbc driver

    Dear Pro.:
    now i am trying to convert my ODBC/C/Oracle project into JDBC/java/Oracle one. i used Oracle 8i database version 8.1.7., but i encounter some questions about this process:
    1. Does the Java SDK version has anything to do with the jdbc driver? i know java2 sdk's newest version is 1.4, and the jdbc is 3.0. what is the best solution for matching jdbc driver with sdk?
    2. which jdbc driver is best for Oracle, and where i can get it? i know i can get from DataDirect(15 day try out version) or Oracle. my project evnironment is simple, i run the Oracle 8.1.7 on my personal computer, that is all.
    3. should i learn SQLJ or just jdbc?
    thank you for your consulting ...

    Dear Pro.:
    now i am trying to convert my ODBC/C/Oracle project into JDBC/java/Oracle one. i used Oracle 8i database version 8.1.7., but i encounter some questions about this process:
    1. Does the Java SDK version has anything to do with the jdbc driver? i know java2 sdk's newest version is 1.4, and the jdbc is 3.0. what is the best solution for matching jdbc driver with sdk? there isn't per say an exact match between JDBC drivers spec and JDK versions
    2. which jdbc driver is best for Oracle, and where i can get it? i know i can get from DataDirect(15 day try out version) or Oracle. my project evnironment is simple, i run the Oracle 8.1.7 on my personal computer, that is all. check 8.1.7 drivers, here http://otn.oracle.com/software/tech/java/sqlj_jdbc/content.html
    3. should i learn SQLJ or just jdbc?
    thank you for your consulting ... SQLJ provides the simplicity of embeding SQL statements in Java similat to embeding SQL statements in C (a.k.a. Pro*C). In Oracle9i Database release 2, SQLJ is functionally on par wiht JDBC ( dynamic SQL, support for advanced JDBC features) - bottom line use SQLJ is you are looking for simplicity, productivity, stronger type checking.
    Kuassi

  • Distribute JDBC driver with our application

    we are not an oracle customer, but we develop an application that has a component that leverages the JDBC driver to connect to the Oracle database. is it ok to distribute the JDBC driver with this application component? i don't see anything in the licensing policy that prevents us from doing so. do we need to be a member of the oracle partner network at a certain level?
    thx.

    we are not an oracle customer, but we develop an application that has a component that leverages the JDBC driver to connect to the Oracle database. is it ok to distribute the JDBC driver with this application component? i don't see anything in the licensing policy that prevents us from doing so. do we need to be a member of the oracle partner network at a certain level?
    You were REQUIRED to accept the license agreement prior to downloading the JDBC driver software. It is expected that you will actually READ the license agreement prior to accepting it.
    Oracle Database 12c Release 1 JDBC Driver Downloads
    You must accept the OTN License Agreement to download this software.
    That license agreement CLEARLY answers your question so you should re-read it. You are bound by ALL of the terms but this is copied directly from that link:
    License Rights
    We grant you a nonexclusive, nontransferable limited license to use the programs: (a) for purposes of developing, testing, prototyping and running applications you have developed for your own internal data processing operations; (b) to distribute the programs with applications you have developed to your customers provided that each such licensee agrees to license terms consistent with the terms of this Agreement, you do not charge your end users any additional fees for the use of the programs, and your end users may only use the programs to run your applications for their own business operations; and (c) to use the programs to provide third party demonstrations and training. You are not permitted to use the programs for any purpose other than as permitted under this Agreement. If you want to use the programs for any purpose other than as expressly permitted under this agreement you must contact us, or an Oracle reseller, to obtain the appropriate license. We may audit your use and distribution of the programs. Program documentation is either shipped with the programs, or documentation may accessed online at http://www.oracle.com/technetwork/indexes/documentation/index.html.
    Item (b) above begins with 'to distribute the programs . . .'
    Yes - you can distribute the JDBC driver as long as you abide by that license agreement in its entirety (not just the quote I provided).
    Any and all questions need to be directed to Oracle as noted in the License Agreement. No one on the forums can speak for Oracle.

  • Using network drive with time machine.  IS IT POSSIBLE?

    There are lots of discussion on using network drives with time machine. I have not been able to make them work. Could somebody tell me if this is possible

    Time Machine does not back up to network drives, except Time Capsules or USB drives connected to an Airport Extreme, or a drive on a Mac running Leopard.
    Here's the official word: http://support.apple.com/kb/HT1733
    You may find some "hacks" that might make it work, in some cases, to a degree. But use them at your own risk.
    First, since this is *unsupported by Apple,* there's nowhere to go when there's trouble.
    Second, you're risking a future update preventing it from working, and perhaps rendering your backups useless.
    If you still think this is a good idea, do yourself a favor before you bet your backups on it: be sure it really works, at least for now:
    1. Get a copy of CarbonCopyCloner or SuperDuper! or the like, and make a full bootable clone of your internal HD, on an external disk. Test it by booting from it. Then reboot from your internal HD.
    2. Let TM do it's first, full, initial backup.
    3. Attempt a full system restore (like you'll need when, not if, your internal HD fails), via the instructions in item 14 of the of the Frequently Asked Questions post at the top of this forum.
    Again, even if it works today, tomorrow is another day . . .

  • Problem using SQL Loader with ODI

    Hi,
    I am having problems using SQL Loader with ODI. I am trying to fill an oracle table with data from a txt file. At first I had used "File to SQL" LKM, but due to the size of the source txt file (700MB), I decided to use "File to Oracle (SQLLDR)" LKM.
    The error that appears in myFile.txt.log is: "SQL*Loader-101: Invalid argument for username/password"
    I think that the problem could be in the definition of the data server (Physical architecutre in topology), because I have left blank Host, user and password.
    Is this the problem? What host and user should I use? With "File to SQL" works fine living this blank, but takes to much time.
    Thanks in advance

    I tried to use your code, but I couldn´t make it work (I don´t know Jython). I think the problem could be with the use of quotes
    Here is what I wrote:
    import os
    retVal = os.system(r'sqlldr control=E:\Public\TXTODI\PROFITA2/Profita2Final.txt.ctl log=E:\Public\TXTODI\PROFITA2/Profita2Final.txt.log userid=MYUSER/myPassword @ mySID')
    if retVal == 1 or retVal > 2:
    raise 'SQLLDR failed. Please check the for details '
    And the error message is:
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 5, in ?
    SQLLDR failed. Please check the for details
         at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
         at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.h.y(h.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)

  • Problem using CORBA clients with RMI/EJB servers..!!!???

    Hi,
    I have a question on using EJB / or RMI servers with CORBA clients using
    RMI-IIOP transport, which in theory should work, but in practice has few
    glitches.
    Basically, I have implemented a very simple server, StockTreader, which
    looks up for a symbol and returns a 'Stock' object. In the first example, I
    simplified the 'Stock' object to be a mere java.lang.String, so that lookup
    would simply return the 'synbol'.
    Then I have implemented the above, as an RMI-IIOP server (case 1) and a
    CORBA server (case 2) with respective clients, and the pair of
    client-servers work fine as long as they are CORBA-to-CORBA and RMI-to-RMI.
    But the problem arises when I tried using the RMI server (via IIOP) with the
    CORBA client, when the client tries to narrow the object ref obtained from
    the naming service into the CORBA idl defined type (StockTrader) it ends up
    with a class cast exception.
    This is what I did to achieve the above results:
    [1] Define an RMI interface StockTrader.java (extending java.rmi.Remote)
    with the method,
    public String lookup( String symbol) throws RMIException;
    [2] Implement the StorckTrader interface (on a PortableRemoteObject derived
    class, to make it IIOP compliant), and then the server to register the stock
    trader with COS Naming service as follows:
    String homeName =....
    StockTraderImpl trader =new StockTraderImpl();
    System.out.println("binding obj <" homeName ">...");
    java.util.Hashtable ht =new java.util.Hashtable();
    ht.put("java.naming.factory.initial", args[2]);
    ht.put("java.naming.provider.url", args[3]);
    Context ctx =new InitialContext(ht);
    ctx.rebind(homeName, trader);
    [3] Generate the RMI-IIOP skeletons for the Implementation class,
    rmic -iiop stock.StockTraderImpl
    [4] generate the IDL for the RMI interface,
    rmic -idl stock.StockTraderImpl
    [5] Generate IDL stubs for the CORBA client,
    idlj -v -fclient -emitAll StockTraderImpl.idl
    [6] Write the client to use the IDL-defined stock trader,
    String serverName =args[0];
    String symList =args[1];
    StockClient client =new StockClient();
    System.out.println("init orb...");
    ORB orb =ORB.init(args, null);
    System.out.println("resolve init name service...");
    org.omg.CORBA.Object objRef
    =orb.resolve_initial_references("NameService");
    NamingContext naming =NamingContextHelper.narrow(objRef);
    ... define a naming component etc...
    org.omg.CORBA.Object obj =naming.resolve(...);
    System.out.println("narrow objRef: " obj.getClass() ": " +obj);
    StockTrader trader =StockTraderHelper.narrow(obj);
    [7] Compile all the classes using Java 1.2.2
    [8] start tnameserv (naming service), then the server to register the RMI
    server obj
    [9] Run the CORBA client, passing it the COSNaming service ref name (with
    which the server obj is registered)
    The CORBA client successfully finds the server obj ref in the naming
    service, the operation StockTraderHelper.narrow() fails in the segment
    below, with a class cast exception:
    org.omg.CORBA.Object obj =naming.resolve(...);
    StockTrader trader =StockTraderHelper.narrow(obj);
    The <obj> returned by naming service turns out to be of the type;
    class com.sun.rmi.iiop.CDRInputStream$1
    This is of the same type when stock trader object is registered in a CORBA
    server (as opposed to an RMI server), but works correctly with no casting
    excpetions..
    Any ideas / hints very welcome.
    thanks in advance,
    -hari

    On the contrary... all that is being said is that we needed to provide clearer examples/documentation in the 5.1.0 release. There will be no difference between the product as found in the service pack and the product found in the 5.1.1. That is, the only substantive will be that 5.1.1 will also
    include the examples.
    "<=one way=>" wrote:
    With reference to your and other messages, it appears that one should not
    expect that WLS RMI-IIOP will work in a complex real-life system, at least
    not now. In other words, support for real-life CORBA clients is not an
    option in the current release of WLS.
    TIA
    "Eduardo Ceballos" <[email protected]> wrote in message
    news:[email protected]...
    We currently publish an IDL example, even though the IDL programmingmodel in Java is completely non-functional, in anticipation of the support
    needs for uses who need to use IDL to talk to the Weblogic server,
    generically. This example illustrates the simplest connectivity; it does not
    address how
    to integrate CORBA and EJB, a broad topic, fraught with peril, imo. I'llnote in passing that, to my knowledge, none of the other vendors attempt
    this topic either, a point which is telling if all the less happy to hear.
    For the record then, what is missing from our distribution wrt RMI-IIOPare a RMI-IIOP example, an EJB-IIOP example, an EJB-C++. In this you are
    correct; better examples are forth coming.
    Still, I would not call our RMI-IIOP implementation fragile. I would saythat customers have an understandably hard time accepting that the IDL
    programming model is busted; busted in the sense that there are no C++
    libraries to support the EJB model, and busted in the sense that there is
    simply no
    support in Java for an IDL interface to an EJB. Weblogic has nothing to doit being busted, although we are trying to help our customers deal with it
    in productive ways.
    For the moment, what there is is a RMI (over IIOP) programming model, aninherently Java to Java programming model, and true to that, we accept and
    dispatch IIOP request into RMI server objects. The way I look at it is this:
    it's just a protocol, like HTTP, or JRMP; it's not IDL and it has
    practically nothing to do with CORBA.
    ST wrote:
    Eduardo,
    Can you give us more details about the comment below:
    I fear that as soon as the call to narrow succeeds, the remainingapplication will fail to work correctly because it is too difficult ot
    use an idl client in java to work.It seems to me that Weblogic's RMI-IIOP is a very fragile
    implementation. We
    don't need a "HelloWorld" example, we need a concrete serious example(fully
    tested and seriously documented) that works so that we can get a betteridea
    on how to integrate CORBA and EJB.
    Thanks,
    Said
    "Eduardo Ceballos" <[email protected]> wrote in message
    news:[email protected]...
    Please post request to the news group...
    As I said, you must separate the idl related classes (class files and
    java
    files) from the rmi classes... in the rmic step, you must set a newtarget
    (as you did), emit the java files into that directory (it's not clearyou
    did this), then remove all the rmi class files from the class path... ifyou
    need to compile more classes at that point, copy the java files to theidl
    directly is you must, but you can not share the types in any way.
    I fear that as soon as the call to narrow succeeds, the remainingapplication will fail to work correctly because it is too difficult otuse
    an idl client in java to work.
    Harindra Rajapakshe wrote:
    Hi Eduardo,
    Thanks for the help. That is the way I compiled my CORBA client, by
    separating the IDL-generated stubs from the RMI ones, but still I
    get a
    CORBA.BAD_PARAM upon narrowing the client proxy to the interfacetype.
    Here's what I did;
    + Define the RMI interfaces, in this case a StockTrader interface.
    + Implement RMI interface by extendingjavax.rmi.PortableRemoteObject
    making
    it IIOP compliant
    + Implemnnt an RMI server, and compile using JDK1.2.2
    + use the RMI implementation to generate CORBA idl, using RMI-IIOPplugin
    utility rmic;
    rmic -idl -noValueMethods -always -d idl stock.StockTraderImpl
    + generate Java mappings to the IDL generated above, using RMI-IIOPplugin
    util,
    idlj -v -fclient -emitAll -tf src stocks\StockTrader.idl
    This creates source for the package stock and also
    org.omg.CORBA.*
    package, presumably IIOP type marshalling
    + compile all classes generated above using JDK1.2.2
    + Implement client (CORBA) using the classes generated above, NOTthe
    RMI
    proxies.
    + start RMI server, with stockTrader server obj
    + start tnameserv
    + start CORBA client
    Then the client errors when trying to narrow the obj ref from the
    naming
    service, into the CORBA IDL defined interface using,
    org.omg.CORBA.Object obj =naming.resolve(nn);
    StockTrader trader =StockTraderHelper.narrow(obj); // THIS
    ERRORS..!!!
    throwing a CORBA.BAD_PARAM exception.
    any ideas..?
    Thanks in advance,
    -hari
    ----- Original Message -----
    From: Eduardo Ceballos <[email protected]>
    Newsgroups: weblogic.developer.interest.rmi-iiop
    To: Hari Rajapakshe <[email protected]>
    Sent: Wednesday, July 26, 2000 4:38 AM
    Subject: Re: problem using CORBA clients with RMI/EJBservers..!!!???
    Please see the post on june 26, re Errors compiling... somewherein
    there,
    I suspect, you are referring to the rmi class file when you are
    obliged
    to
    completely segregate these from the idl class files.
    Hari Rajapakshe wrote:
    Hi,
    I have a question on using EJB / or RMI servers with CORBA
    clients
    using
    RMI-IIOP transport, which in theory should work, but in practice
    has
    few
    glitches.
    Basically, I have implemented a very simple server,
    StockTreader,
    which
    looks up for a symbol and returns a 'Stock' object. In the firstexample, I
    simplified the 'Stock' object to be a mere java.lang.String, so
    that
    lookup
    would simply return the 'synbol'.
    Then I have implemented the above, as an RMI-IIOP server (case
    1)
    and a
    CORBA server (case 2) with respective clients, and the pair of
    client-servers work fine as long as they are CORBA-to-CORBA andRMI-to-RMI.
    But the problem arises when I tried using the RMI server (via
    IIOP)
    with
    the
    CORBA client, when the client tries to narrow the object ref
    obtained
    from
    the naming service into the CORBA idl defined type (StockTrader)
    it
    ends
    up
    with a class cast exception.
    This is what I did to achieve the above results:
    [1] Define an RMI interface StockTrader.java (extending
    java.rmi.Remote)
    with the method,
    public String lookup( String symbol) throws RMIException;
    [2] Implement the StorckTrader interface (on a
    PortableRemoteObject
    derived
    class, to make it IIOP compliant), and then the server to
    register
    the
    stock
    trader with COS Naming service as follows:
    String homeName =....
    StockTraderImpl trader =new StockTraderImpl();
    System.out.println("binding obj <" homeName ">...");
    java.util.Hashtable ht =new java.util.Hashtable();
    ht.put("java.naming.factory.initial", args[2]);
    ht.put("java.naming.provider.url", args[3]);
    Context ctx =new InitialContext(ht);
    ctx.rebind(homeName, trader);
    [3] Generate the RMI-IIOP skeletons for the Implementation
    class,
    rmic -iiop stock.StockTraderImpl
    [4] generate the IDL for the RMI interface,
    rmic -idl stock.StockTraderImpl
    [5] Generate IDL stubs for the CORBA client,
    idlj -v -fclient -emitAll StockTraderImpl.idl
    [6] Write the client to use the IDL-defined stock trader,
    String serverName =args[0];
    String symList =args[1];
    StockClient client =new StockClient();
    System.out.println("init orb...");
    ORB orb =ORB.init(args, null);
    System.out.println("resolve init name service...");
    org.omg.CORBA.Object objRef
    =orb.resolve_initial_references("NameService");
    NamingContext naming=NamingContextHelper.narrow(objRef);
    ... define a naming component etc...
    org.omg.CORBA.Object obj =naming.resolve(...);
    System.out.println("narrow objRef: " obj.getClass() ":"
    +obj);
    StockTrader trader =StockTraderHelper.narrow(obj);
    [7] Compile all the classes using Java 1.2.2
    [8] start tnameserv (naming service), then the server to
    register
    the
    RMI
    server obj
    [9] Run the CORBA client, passing it the COSNaming service ref
    name
    (with
    which the server obj is registered)
    The CORBA client successfully finds the server obj ref in the
    naming
    service, the operation StockTraderHelper.narrow() fails in thesegment
    below, with a class cast exception:
    org.omg.CORBA.Object obj =naming.resolve(...);
    StockTrader trader =StockTraderHelper.narrow(obj);
    The <obj> returned by naming service turns out to be of the
    type;
    class com.sun.rmi.iiop.CDRInputStream$1
    This is of the same type when stock trader object is registeredin a
    CORBA
    server (as opposed to an RMI server), but works correctly with
    no
    casting
    excpetions..
    Any ideas / hints very welcome.
    thanks in advance,
    -hari

  • DatabaseMetaData.getTypeInfo ()=NULL when use JDBC Driver 9.2.0.5

    Why DatabaseMetaData.getTypeInfo () is NULL when use JDBC Driver 9.2.0.5 to connect Oracle 9.0.1.1.1 database?
    In the following links
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#02_02
    the segment "Which JDBC drivers support which versions of Oracle Database?" tells us that JDBC Driver 9.2.0.5 can support Oracle 9.0.1.1.1 database.
    thanks!

    ERROR --- java.sql.SQLException: ORA-01722: &#26080;&#25928;&#25968;&#23383;

  • Scope when using a JavaBean with JSP

    what is the meaning of this question .....?
    "Which of the following can not be used as the scope when using a JavaBean with JSP? "
    question 4
    site :http://java.sun.com/developer/Quizzes/jsptut/

    The question is clearly written. I don't see how you can be confused. But let's assume you are since you would not have posed the question.
    Dumbed-down:
    There are 4 scopes or areas of variable visibility in JavaServer Pages. Which of those can areas can not be used with JavaBeans?
    Does that help?

Maybe you are looking for