Point Database tutorial but using Derby Database in NetBeans IDE

Hi
I am getting an error when I am trying to run the EJB Entity beans BMP example "savingsaccount" in the examples folder of j2eetutorials .
I have using NEtBeans IDE + Sun APP server and the following the tutorial Netbeans + J2ee tutorials...
THe problem is the tutorial talks about a "pointdatabase" 8.1 verson and the Sun App Server I have is 8.2 which has "Derby Database".
However I made the necessary changes in the code. Siill the error is someting like this :
"ar 27, 2006 3:40:57 AM com.sun.corba.ee.spi.logging.LogWrapperBase doLog
INFO: "IOP00710299: (INTERNAL) Successfully created IIOP listener on the specified host/port: all interfaces/1366"
Exception is caught: RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException: ejbCreate: Invalid argument: parameter index 1 is out of range.
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException: ejbCreate: Invalid argument: parameter index 1 is out of range.
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:161)
at javax.rmi.CORBA.Util.mapSystemException(Util.java:67)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:142)
at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source)
at bank._SavingsAccountRemoteHome_DynamicStub.create(_SavingsAccountRemoteHome_DynamicStub.java)
at savingsaccountclient.Main.main(Main.java:64)
Caused by: java.rmi.RemoteException: ejbCreate: Invalid argument: parameter index 1 is out of range.
....and more...
So I am not sure whether this is some fault of the application or the database access errior...?
Someone who tried this let me know plz...
thanks
deepesh

Microsoft SQL Driver 2005 JDBC Driver is not the Derby driver.
You need the correct JDBC driver for the database you are using, you can't simply grab the first one you find.

Similar Messages

  • How to use Derby database in embedded mode in WebLogic 12c?

    I have a JavaEE-6 application that uses Derby database in embedded mode. It uses JPA for persistence. Everything works fine in Glassfish but now I am trying to port it to WebLogic 12c and having issues setting up Derby database in WLS in embedded mode. The derby setup in WLS asks for Host/port and does not have the embedded mode option. Any help is appreciated.
    -Prantor

    I'm pretty sure this is the wrong forum. "Oracle Application Server" is iAS, not WebLogic.

  • What kind of database driver should use for database adapter  in BPEL?

    what kind of database driver (XA or non-XA) should use for database adapter in BPEL? I have only one database adapter and no JMS.
    Thanks
    Jo
    Edited by: 799095 on Sep 30, 2010 8:35 AM

    Hi
    It depends on wheter you need XA transaction or not.
    See http://www.theserverside.com/discussions/thread.tss?thread_id=21385 third reply.
    If you only have one database and no synchronous dependency to the caller, non-XA should be OK.
    -Johan

  • Runtime Error using JDBC Driver in NetBeans IDE 6.9.1

    Hello,
    I receive a compiler error which reads as follows;
    java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver
    java.sql.SQLSyntaxErrorException: Schema 'DEMO' does not exist
    Heres the main body of code i am trying to execute.
    public class Main {
    @param args the command line arguments
    public static void main(String[] args) {
    // TODO code application logic here
    try{
    Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
    }catch(ClassNotFoundException e){
    System.out.println(e);
    try{
    Connection con = DriverManager.getConnection("jdbc:derby://localhost:1527/SimpleDBDemo", "demo", "demo");
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * FROM DEMO.Table1");
    while (rs.next()) {
    String s = rs.getString("Name");
    float n = rs.getFloat("Age");
    System.out.println(s " " n);
    }catch(SQLException e){
    System.err.println(e);
    I am using NetBeans IDE and have created a database under: Services->Databases-> Java DB->SimpleDBDemo.
    I have a database connection in which theres a simple table (called "TABLE1") created which contains the names and ages of two people. I am trying to access the data of these two people.
    From what i can figure out i am getting a runtime error. I have downloaded a folder called "Microsoft SQL Driver 2005 JDBC Driver" which contains the "sqljdbc.jar" executable file. I copied the jar file to the library in "Program files->Sun->javadb" and then added the file to the project libraries section i.e. "Project->properties->add JAR/Folder->sqljdbc.jar" in netbeans.
    I am still getting the same runtime error. Have i the sqljdbc.jar file added in the wrong place?
    Any help would be greatly appreciated.

    Microsoft SQL Driver 2005 JDBC Driver is not the Derby driver.
    You need the correct JDBC driver for the database you are using, you can't simply grab the first one you find.

  • Database functions without using a database

    I think I should have posted this here instead of on the
    basics are. Anyway here is my problem.
    I'm creating a little standalone program that needs to have
    database like functions. The program needs to store data fields
    like names, titles, etc. that can be modified/customized by the
    user. I've done this before in mySQL. But I don't want the user to
    have to go to a website or have a database loaded on their
    computer. I just want the fields to be stored in some type of
    document file that would be in the same folder as the program. Any
    suggestions?

    There are several options - all require some simple
    scripting. To name a couple:
    Director can write to text files with the built-in Fileio
    xtra, so you could create a delimited text file database.
    Director's list functions are perfect for creating a simple
    database. You can save lists to files easily using the propSave or
    vList xtras - fre IIRC for simple this simple functionality
    http://www.updatestage.com/products_table.html
    hth
    johnAq

  • Problem creating parent child relatioship in derby database

    hi.i m trying to develop a code that can access two tables using derby database.The data in the tables should go from the JTable of GUI which i have prepared.To read both table's properties i m using two different instances of java.util.Properties.using InputStream i m reading the properties and then i try to create the tables.The parent table is created but the child table is never created.Also i m able to insert as well as fetch the data from parent table but the child table,as not created throws Derby's error messages.
    I need help in this matter.
    Could anybody give suggestions?

    The problem in creating a child table is that i m using two different .property files for two tables,one for parent and one for child table.I perform all the steps similar to those i performed to create parent table.But i dont know,somehow it creates only parent table and all the time when i run the code the error message for the child table comes that the table does not exist.

  • Openscript 9.0 - Using a database as a databank

    Hello
    Looking at the documentation for version 9.0 (OpenScriptUsersGuide.pdf). I notice page 4-1 states,
    <<Data Input Sources enables users to drive input values from an external CSV file or
    other external data source such as a database (i.e. using a database query to pull inputs
    from a database table).>>
    However when using openscript I cannot see anyway of selecting anything other than a file as a databank?
    Is this possible?
    I'd like to be able to point the script at an SQL statement which selects a result set from a database.
    Thanks
    Steve

    HI
    Make sure you select the Initialize or Run methods, depending on where you try to define the database connection it will not let you do it.
    Good practice would be to define the database and the connection in the initialize section, the SQL and execute in the Run section and the disconnect in the Finish section, however that could change depending on your needs.
    Regards
    Alex

  • Derby database

    Hi all,
    Trying to get Derby up and running. I have set up the following Environment Variables:
    DERBY_HOME: C:\Apache\db-derby-10.3.1.4-bin
    CLASSPATH :
    .;C:\Program Files\QuickTime\QTSystem\QTJava.zip; %DERBY_HOME%\lib\derby.jar; %DER
    BY_HOME%\lib\derbytools.jar;
    I'm trying to created a new database from the command prompt but keep getting an exception:
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/derby/tool
    s/ij
    I'm really not sure what I'm doing wrong because I when I run the sysinfo.bat I get the required output. I'm trying to run the ij tool with the following line when I get the error.
    C:\Apache\db-derby-10.3.1.4-bin>java org.apache.derby.tools.ij

    I see that I can run the ij command from the \bin directory but then when I create the database its in that directory and not the folder that I created for the database. When I check the log I also see something peculiar:
    Database Class Loader started - derby.database.classpath=''From what I see here there is no classpath?? I'm I correct in my assumption or is that the way it should be.
    When I echo the CLASSPATH I do see the derby.jar and derbytools.jar paths added to the list.

  • How to retrieve data using logical database and custom select options

    Hi all,
    I have a selection screen which is displayed by logical database PSJ and I have two select options of my own. I need to retrieve data based on both selection screen of logical database and my own select options. How can I do it?
    Thanks in advance.

    Hai Gupta
    Check the following Document & Links
    1. A logical database is in fact
    a program only.
    2. This LDB provides two main things :
    a) a pre-defined selection screen
    which handles all user inputs and validations
    b) pre defined set of data
    based upon the user selection.
    3. So we dont have to worry about from
    which tables to fetch data.
    4. Moreover, this LDB Program,
    handles all user-authorisations
    and is efficient in all respects.
    5. tcode is SLDB
    good info about Logical Database. you can check the link.
    http://www.geekinterview.com/question_details/1506
    http://help.sap.com/saphelp_46c/helpdata/EN/35/2cd77bd7705394e10000009b387c12/frameset.htm
    Re: How to Create and Use ldb in reports?
    Re: Logical databases
    http://help.sap.com/saphelp_46c/helpdata/en/9f/db9bed35c111d1829f0000e829fbfe/frameset.htm
    Functions for displaying and changing logical databases:
    Call Transaction SE36 or
    Choose ABAP Workbench -> Development -> Programming environ. -> Logical databases
    Interaction between database program and report:
    During program processing, subroutines are performed in the database program and events are executed in the report.
    To read data from a database tables we use logical database.
    A logical database provides read-only access to a group of related tables to an ABAP/4 program.
    advantages:-
    The programmer need not worry about the primary key for each table.Because Logical database knows how the different tables relate to each other,and can issue the SELECT command with proper where clause to retrieve the data.
    i)An easy-to-use standard user interface.
    ii)check functions which check that user input is complete,correct,and plausible.
    iii)meaningful data selection.
    iv)central authorization checks for database accesses.
    v)good read access performance while retaining the hierarchical data view determined by the application logic.
    disadvantages:-
    i)If you donot specify a logical database in the program attributes,the GET events never occur.
    ii)There is no ENDGET command,so the code block associated with an event ends with the next event
    statement (such as another GET or an END-OF-SELECTION).
    1. transaction code SLDB.
    2.enter name z<ldb-name>
    3.create
    4.short text
    5.create
    6. name of root node (here Ekko)
    7. enter short text (f6)
    8.node type -> data base table.
    9.create
    10 change logical DB
    riht click on ekko and insert node
    here node name ekpo
    11.create
    12. click on selections
    13. press no Should the changed structure of Z<ldb name> be saved first.
    14.select tables which you want to join.
    15.transfer
    16 now you have to o to coding part.
    17. save
    activate.
    19.click to src code
    double click on first include and activate
    Regards
    Sreeni

  • Logical database vs direct access of database table

    Hi
    I have created a FI report.    I am trying to get data from large FI tables like BSAK, BSEG, BKPF, RSEG.  eventhough there are 10 records as per my criteria, system is taking morethan an hour time even in background processing.  This may be becaz of lot of conditions that I am applying to filter the data.  But still trying to improve the performance
    For fetching data which is the better way for getting optimum performance of the report.
    a) directly fetching data from database tables
    b) using logical database collecting data into an itab
    regards,
    mallik

    Hi,
    If you are accessing the database tables more than once with different criteria then definetly it will take more time. In such case write only one Select statement on the table and get all the required data into an internal table and then process this internal table as per your logic.
    Use of LDBs is definetly faster but filter conditions might not match with your filter conditions. In such case direct access of database table is preferable but as i said in above paragraph.
    thanks,
    sksingh

  • Doubt about database point in time recovery using rman

    Hi Everyone,
    I have been practising various rman restore and recovery scenarios . I have a doubt regarding database point in time recovery using rman. Imagine i have a full database backup including controlfile scheduled to run at 10 PM everyday. today is 20th dec 2013. imagine i want to restore the database to a prior point in time ( say 18th dec till 8 AM). so i would restore all the datafiles  from 17th night's backup and apply archives till 8 AM of 18th dec . in this scenario should i restore the controlfile too from 17th dec bkp ( i am assuming yes we should ) or can we use the current controlfile ( assuming it is intact). i found the below from oracle docs.
    Performing Point-in-Time Recovery with a Current Control File
    The database must be closed to perform database point-in-time recovery. If you are recovering to a time, then you should set the time format environment variables before invoking RMAN. The following are sample Globalization Support settings:
    NLS_LANG = american_america.us7ascii
    NLS_DATE_FORMAT="Mon DD YYYY HH24:MI:SS"
    To recover the database until a specified time, SCN, or log sequence number:
    After connecting to the target database and, optionally, the recovery catalog database, ensure that the database is mounted. If the database is open, shut it down and then mount it:
    2.  SHUTDOWN IMMEDIATE;
    3.  STARTUP MOUNT;
    4. 
    Determine the time, SCN, or log sequence that should end recovery. For example, if you discover that a user accidentally dropped a tablespace at 9:02 a.m., then you can recover to 9 a.m.--just before the drop occurred. You will lose all changes to the database made after that time.
    You can also examine the alert.log to find the SCN of an event and recover to a prior SCN. Alternatively, you can determine the log sequence number that contains the recovery termination SCN, and then recover through that log. For example, query V$LOG_HISTORY to view the logs that you have archived. 
    RECID      STAMP      THREAD#    SEQUENCE#  FIRST_CHAN FIRST_TIM NEXT_CHANG
             1  344890611          1          1      20037 24-SEP-02      20043
             2  344890615          1          2      20043 24-SEP-02      20045
             3  344890618          1          3      20045 24-SEP-02      20046
    Perform the following operations within a RUN command:
    Set the end recovery time, SCN, or log sequence. If specifying a time, then use the date format specified in the NLS_LANG and NLS_DATE_FORMAT environment variables.
    If automatic channels are not configured, then manually allocate one or more channels.
    Restore and recover the database.
      The following example performs an incomplete recovery until November 15 at 9 a.m. 
    RUN
      SET UNTIL TIME 'Nov 15 2002 09:00:00';
      # SET UNTIL SCN 1000;       # alternatively, specify SCN
      # SET UNTIL SEQUENCE 9923;  # alternatively, specify log sequence number
      RESTORE DATABASE;
      RECOVER DATABASE;
    If recovery was successful, then open the database and reset the online logs:
    5.  ALTER DATABASE OPEN RESETLOGS;
    I did not quiet understand why the above scenario is using current controlfile as the checkpoint scn in the current controlfile and the checkpoint scn in the datafile headers do not match after the restore and recovery. Thanks in Advance for your help.
    Thanks
    satya

    Thanks for the reply ... but what about the checkpoint scn in the controlfile . my understanding is that unless the checkpoint scn in the controlfile and datafiles do not match the database will not open. so assuming the checkpoint scn in my current controlfile is 1500 and i want to recover my database till scn 1200. so the scn in the datafiles (which is 1200) is not not matching with the scn in the controlfile(1500). so will the database open in such cases.
    Thanks
    Satya

  • How to use Electroserver's built in Derby Database?

    hello. I am trying to create an online multiplayer game with electroserver like here:
    http://gamesfromjames.weebly.com/pickit.html
    I was looking at the source code from electrotank. Unfortunately, I cannot compile it in flash CS6 because the document class is in mxml.(if someone can help me figure out how to test these examples  in pure as3 that would be great)  I did find these two functions in hte mxml class:
                 * Increases your rank by the amount specified by sending a properly formatted message to the plugin.
                private function addToRankClicked():void {
                    var ipr:PluginRequest = new PluginRequest();
                    ipr.pluginName = "DatabasePlugin";
                    var esob:EsObject = new EsObject();
                    esob.setString(PluginConstants.ACTION, PluginConstants.TAG_ADD_TO_RANK);
                    esob.setInteger(PluginConstants.TAG_ADD_TO_RANK, rankDeltaStepper.value);
                    ipr.parameters = esob;
                    _es.engine.send(ipr)
                 * Loads your rank from the database by asking the plugin for it.
                private function getRank():void {
                    var ipr:PluginRequest = new PluginRequest();
                    ipr.pluginName = "DatabasePlugin";
                    ipr.zoneId = -1;
                    ipr.roomId = -1;
                    var esob:EsObject = new EsObject();
                    esob.setString(PluginConstants.ACTION, PluginConstants.TAG_GET_RANK);
                    ipr.parameters = esob;
                    _es.engine.send(ipr)
    Is this all that is needed to put things into the database and take things out or am I missing something?
    If I was going to try to save the chat history and show it every time a user enters the chat room, how would I go about doing it with electroserver's derby database?
    Thanks!

    Use Flex/Flashbuilder to compile mxml source code.
    There are many Flash Games on their Example site: http://www.electrotank.com/docs/es5/manual/

  • Connecting to a database in JSP but using connection in bean

    I have a bean which connects to a database which is as follows:
    package MyPackage;
    import java.sql.*;
    public class DataSourceBean{
            public DataSourceBean(){
         public void setDriver(String driver) throws ClassNotFoundException {
              Class.forName(driver);
         public void setUrl(String aUrl){
              url=aUrl;
         public void setUsername(String aUsername){
              username=aUsername;
         public void setPassword(String aPassword){
              password=aPassword;
         public static Connection getConnection() throws SQLException{
              return DriverManager.getConnection(url, username, password);
         private static String url;
         private static String username;
         private static String password;
    }I then connect to a database through my JSP page:
    <jsp:useBean id="db" class="MyPackage.DataSourceBean" scope="application">
       <jsp:setProperty name="db" property="driver" value="sun.jdbc.odbc.JdbcOdbcDriver" />
       <jsp:setProperty name="db" property="url" value="jdbc:odbc:MyDB" />
    </jsp:useBean>This opens the database for the session, but I then want to allow people to login using a seperate bean.
    My question is how do I use the connection created in the JSP page above in my login bean?
    I have also tried connecting to a database in my LoginBean by using:
    DataSourceBean dsb=new DataSourceBean();
    yet it doesn't recognise DataSourceBean for some reason.
    BTW my book suggests opening up the database using scope="application" but to me it seems that keeping the database open is risky, is it OK to keep the database open for the whole session? do you have any other suggestions for accessing the database through my DataSourceBean?
    Thanks for any help.

    hi shock,
    there are a number of considerations when it comes to the database connections.
    first of all is the database server yours or are you buying a hosting scheme?
    if the database server is yours then you may consider building a database connection pool and keeping it in a session parameter. there's no harm in that because connections are opened as needed and closed when not needed. you can specify the minimum and maximum number of connections and connectio keep-alive times.
    if you purchase your database from a host they possibly would object to having a db connection pool as connections are valuable for them. but in this case there is no harm to create a connection to the database per request because creating database connections are costly only for the database server. your application will not slow down that much.
    for performance check sites: www.crystaltours.com or www.seckinkonaklar.com
    in both sites all connections are created per request and the complete content (including menus and application properties) comes from the database.
    my suggestion is that if you are writing a commercial application that will be hosted in a server that is not yours then create a connection per request (no pooling here).
    i also would suggest to put your database access code in a single class -not in a bean- for easy maintenance, you can use that class in your beans.
    i hope this was your answer.
    cem.

  • How to access the database jar file using the derby 10.2.1.6 database ?

    Hi,
    How to access the database jar file using the derby 10.2.1.6 database ?
    I have used like below. And i am getting the following the error:
    "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.apache.derby.jdbc.EmbeddedDriver'
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1136)"
    My context.xml file looks like this:
    <Context crossContext="true">
    <Resource name="jdbc/derby" auth="Container"
    type="javax.sql.DataSource" driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
    url="jdbc:derby:jar(\CalypsoDemo\database.jar)samples"
    username="xxx" password="xxx" maxActive="20" maxIdle="10"
    maxWait="-1"/>
    </Context>
    What could be the reason.?
    Any suggestions will be appriciated.
    Thanks in Advance,
    Gana.

    ya, I have restarted. Can you please tell me whether the path which i am giving is right or not in the context file?
    Thanks,
    Gana.

  • Using a database in Sun's "Open Office"

    hi
    I could think this tip is not suitable for this forum, but I didn't find another
    so I try here to have an answer to a my question that, I think, can be interesting for other people too...
    I would see in DataBase section of Sun's "Open Office" the data that my program register in a Derby database.
    My first question is if this is possible..
    If this is possible, my second question is: how to get the connection to the database?
    *In the wizard , there are two components to put information in order to get the connection:
    -(1) URL to the source data: jdbc: .....
    -(2) Class of the driver:*
    I made several tries to get the connection:
    In the textBox (2) I put the path to the derby.jar that I use in the application
    but when I push the button I got the message:
    ------"The driver JDBC wasn't load".------
    Could I have same help about what information I have to put there ?
    About the second input data, I think that in the box (1) I should put the (absolute) path to database that I would have the access..
    but..., way it begin with jdbc: ?
    Thank you for an explanation about what is the mean of the two components where put the input data....
    regards
    tonyMrsangelo

    thank you jshell to spend time with your explanation..
    I try to explain how I am seeing the problem:
    In the Drby manual I read:
    Derby consists of both the database engine and an embedded JDBC driver.
    Applications use JDBC to interact with a database. Applications running on JDK 1.5 or earlier, must load the driver in order to work with the database.
    In an embedded environment, loading the driver also starts Derby.
    In a Java application, you typically load the driver with the static Class.forName method or with the jdbc.drivers system property.
    For example: Class.forName("org.apache.derby.jdbc.EmbeddedDriver");In the java code I get a connection with this statements:
        private Connection getConnection(){ // 
                String driver = "org.apache.derby.jdbc.EmbeddedDriver";  // name of driver.
                try {
                    Class.forName(driver);      // N.B. Derby.jar have to bein the classpath...
                    System.out.println(driver + " loaded. ");
                } catch(java.lang.ClassNotFoundException e)     {
                    System.err.print("ClassNotFoundException: ");
                    System.err.println(e.getMessage());
                    System.out.println("\n    >>> Please check your CLASSPATH variable   <<<\n");
                String  connectionURL = "jdbc:derby:" + path + dbName;
                Connection dbconn  = null;
                try {
                    dbconn = DriverManager.getConnection(connectionURL);  // V.I. too
                    System.out.println("Connected to database " + dbName);
                } catch (SQLException ex) {
                    JOptionPane.showMessageDialog(null, ex.getMessage());
                } catch ( Exception excp ) {              // process remaining Exceptions here
                    excp.printStackTrace();
            return dbconn;
        } // getConnection()At this point I think that I should give to Sun's Open Office the same intormation that I do in the java code ..
    Of course I have to do it with a different syntax....
    I think I have to put:
    in the (1) the value of the String connectionURL
    in the (2) the value of the String driver .
    And to give the classpath to "Sun's Open Office" I should go in the menu option : [tools --> options --> OpenOffice.orgBase -- connection]
    to activate the link with the driver derby.jar...
    It was good for me talking with you was because now I think to see the problem in a more correct way..
    What do you think about ?
    Regards..

Maybe you are looking for

  • How can i do if i want to add number to the filenames of my pic in my macpro

    how can i do if i want to add number to the filenames of my pics in my macpro? if someone can help

  • Is Index organization tables better in performance compare to normal tables

    Hi, i am using oracle 10g and my domain is on telecom. my requirement is when 'A' party calls 'B' Party based on 'B' party number we have to find which area the call lands based on that tariff will be applied but the data configured in Area table is

  • ISE Issue with DNS

    Hello Techies, I am facing challenge while configuring ISE to join AD. Domain Name lookup fails. DNS is working perfectly fine; nslookup works fine on ISE for simple domain names, but on long domain  names it fails while throwing the following error;

  • Upgrade & change of language

    Hi there! I´d like to upgrade my CS5 master collection (german version) to CS6 (english version). Is that possible or are there problems changing the languange of an upgrade? greetings & many thanks! p.

  • NAT on 2621 HELP!!!

    I have spent a few hours trying to NAT out a few intenal 192.168.x.x hosts through both my ethernet1/0 interface and also tryed using another IP from the range. Any help GREATLY appreciated. Thanks! (Config below) Building configuration... Current co