Mystories of a simple data-base

hi,
I'm having the wierdest problem, and I'm hoping someone could shed a bit of light on this for me.
I'm trying to insert two things to the DB at once - so I have to insert stmts :
INSERT INTO CASES_PAYMENTS_T (CAPY_case_tech_id ,CAPY_exception_text ,CAPY_is_exception,CAPY_sum,CAPY_date,CAPY_voucher,CAPY_is_paid_in_hotzlap) VALUES ( 5,'',false,324333,'1970-01-01','2222 ',false )
INSERT INTO COLLECTIONS_T (COLL_sum ,COLL_year ,COLL_exception_text ,COLL_is_exception ,COLL_date ,COLL_office_case_id,COLL_voucher,COLL_paid_in_hotzlap,COLL_case_tech_id) VALUES ( 324333,2,'',false,'1970-01-01',1,'2222 ',false,5 )
but for some reason when I do commit, only the second one adds to my DB (which is access, btw).
I don't get any exceptions.
everyrthing looks ok.
i even get a return value on "select @@IDENTITY" after the first insert statement.
ideas?

sure - it has one primary key field, named CAPY_tech_id which is an autoNumber field in access - i'm not setting its value - access gives the new record a value (which I retrieve using the "select @@IDENTITY")
I don't have any other constraints on this table (or any other).
you see, the thing is that I created a generic Entity class named "UnionEntity" which is the super-class of another class : UnionCasePayment. this class actually represent a record from the table. I used it before in my program, and I still use it and it works in other places.
I just can't figure why it doesn't work when I have two records pending for commit.

Similar Messages

  • Simple Data Base Program for Mountain Lion

    Does anyone have a recommendation for a simple data base program that will import comma delimited fields from early versions of Filemaker Pro (v 3.0, v5.0)
    The ability to import Filemaker Templates and Layouts would be a big plus.
    I do not need the a highly sophisticated program just something with the ability to import data from several different data bases and create layouts that look like I want them to look.  
    Also what is the earliest version of Filemaker that will run well on Mountain Lion ?
                                                                            Thanks....Ken

    I suggest Bento (by Filemaker), simple database, imports Filemaker Pro files and doesn't cost very much

  • What's a simple data base to use? I want to include photos with each item (jewelry)..

    Okay, here's what I want to do. The wife's got at bunch of the wife's jewelry plus a few rare coins that need to go into the safety deposit box soon but before that, I need at least one photo of each item along with its details. This is the first time I've done something like this so it'll be a learning experience. I plan to get an iPad sometime in the next month but right now I'm just experimenting;  using a point and click camera and a notepad.  (Question, would my iPod Touch make this easier in any way?)
    Can you recommend a simple and inexpensive app that would make that process relatively painless? Until, the iPad arrives, my handwritten notes will go onto a document on my MacBook Pro....?
    Anyway, there's got a be an easier way to do this.
    Looking forward to your thoughts.
    Brian
    PS: Apologies if this isn't the best community for this question. Apple's support options seem to have really changed since I was last here. Feel free to suggest other groups who could answer the above question better.

    There are several home inventory apps available in the app store. Many include the ability to add photos and most would probably work on the Touch as well as an iPad.

  • Data base app?

    Does anyone know of an easy to use iPad App for a very simple data base that will allow insertion of photos?  I want to create a searchable inventory

    Both has its own advanteages and disadvantages I think.
    First of all we use the connection pooling mechanism.
    In all our applications we open one connection for an entire reqeust and pass the connection object along.

  • Differnace b/w SID and Global data base name

    please tell me what is differance b/w SID and global data base name.

    Hi,
    Oracle System Identifier (SID)
    A name that identifies a specific instance of a running pre-release 8.1 Oracle database. For any database, there is at least one instance referencing the database.
    For pre-release 8.1 databases, SID is used to identify the database. The SID is included in the connect descriptor of a tnsnames.ora file and in the definition of the listener in the listener.ora file.
    http://download-uk.oracle.com/docs/cd/B19306_01/network.102/b14213/glossary.htm#i433004
    Global database name
    The full name of the database which uniquely identifies it from any other database. The global database name is of the form "database_name.database_domain," for example, sales.us.acme.com.
    The database name portion, sales, is a simple name you wish to call your database. The database domain portion, us.acme.com, specifies the database domain in which the database is located, making the global database name unique. When possible, Oracle Corporation recommends that your database domain mirror the network domain.
    The global database name is the default service name of the database, as specified by the SERVICE_NAMES parameter in the initialization parameter file.
    http://download-uk.oracle.com/docs/cd/B19306_01/network.102/b14213/glossary.htm#i435858
    Adith

  • Performance problem in select data from data base

    hello all,
    could you please suggest me which select statement is good for fetch data form data base if data base contain more than 10 lac records.
    i am using SELECT PACKAGE SIZE n statement,  but it's taking lot of time .
    with best regards
    srinivas rathod

    Hi Srinivas,
    if you have huge data and selecting ,you could decrease little bit time if you use better techniques.
    I do not think SELECT PACKAGE SIZE  will give good performance
    see the below examples :
    ABAP Code Samples for Simple Performance Tuning Techniques
    1. Query including select and sorting functionality
    tables: mara, mast.
        data: begin of itab_new occurs 0,
                 matnr like mara-matnr,
                 ernam like mara-ernam,
                 mtart like mara-mtart,
                 matkl like mara-matkl,
                 werks like mast-werks,
               aenam like mast-aenam,
    stlal like mast-stlal,
         end of itab_new.
    select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
    into table itab_new from mara as f inner join mast as g on
    fmatnr = gmatnr where gstlal = '01' order by fernam.
    Code B
    tables: mara, mast.
    data: begin of itab_new occurs 0,
          matnr like mara-matnr,
          ernam like mara-ernam,
          mtart like mara-mtart,
          matkl like mara-matkl,
          werks like mast-werks,
          aenam like mast-aenam,
          stlal like mast-stlal,
    end of itab_new.
    select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
    into table itab_new from mara as f inner join mast as g on f~matnr =
    gmatnr where gstlal = '01'.
    sort itab_new by ernam.
    Both the above codes essentially do the same function, but the execution time for code B is considerably lesser than that of Code A. Reason: The Order by clause associated with a select statement increases the execution time of the statement, so it is profitable to sort the internal table once after selecting the data.
    2. Performance Improvement Due to Identical Statements – Execution Plan
    Consider the below queries and their levels of efficiencies is saving the execution
    tables: mara, mast.
    data: begin of itab_new occurs 0,
          matnr like mara-matnr,
          ernam like mara-ernam,
          mtart like mara-mtart,
          matkl like mara-matkl,
          werks like mast-werks,
          aenam like mast-aenam,
          stlal like mast-stlal,
    end of itab_new.
    select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
    into table itab_new from mara as f inner join mast as g on f~matnr =
    gmatnr where gstlal = '01' .
    sort itab_new.
    select fmatnr fernam
    fmtart fmatkl gwerks gaenam g~stlal
    into table itab_new from mara as
    f inner join mast as g on f~matnr =
    gmatnr where gstlal
    = '01' .
    Code D (Identical Select Statements)
    tables: mara, mast.
    data: begin of itab_new occurs 0,
          matnr like mara-matnr,
          ernam like mara-ernam,
          mtart like mara-mtart,
          matkl like mara-matkl,
          werks like mast-werks,
          aenam like mast-aenam,
          stlal like mast-stlal,
    end of itab_new.
    select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
    into table itab_new from mara as f inner join mast as g on f~matnr =
    gmatnr where gstlal = '01' .
    sort itab_new.
    select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
    into table itab_new from mara as f inner join mast as g on f~matnr =
    gmatnr where gstlal = '01' .
    Both the above codes essentially do the same function, but the execution time for code B is considerably lesser than that of Code A. Reason: Each SQL statement during the process of execution is converted into a series of database operation phases. In the second phase of conversion (Prepare phase) an “execution  plan” is determined for the current SQL statement and it is stored, if in the program any identical select statement is used, then the same execution plan is reused to save time. So retain the structure of the select statement as the same when it is used more than once in the program.
    3. Reducing Parse Time Using Aliasing
    A statement which does not have a cached execution plan should be parsed before execution; this parsing phase is a highly time and resource consuming, so parsing time for any sql query must include an alias name in it for the following reason.
    1.     Providing the alias name will enable the query engine to resolve the tables to which the specified fields belong to.
    2.     Providing a short alias name, (a single character alias name) is more efficient that providing a big alias name.
    Code E
    select jmatnr jernam jmtart jmatkl
    gwerks gaenam g~stlal into table itab_new from mara as
    j inner join mast as g on jmatnr = gmatnr where
                g~stlal = '01' .
    In the above code the alias name used is ‘ j ‘.
    4. Performance Tuning Using Order by Clause
    If in a SQL query you are going to  read a particular database record based on some key values mentioned in the select statement, then the read query can be very well optimized by ordering the fields in the same order in which we are going to read them in the read query.
    Code F
    tables: mara, mast.
    data: begin of itab_new occurs 0,
          matnr like mara-matnr,
          ernam like mara-ernam,
          mtart like mara-mtart,
          matkl like mara-matkl,
          end of itab_new.
    select MATNR ERNAM MTART MATKL from mara into table itab_new where
    MTART = 'HAWA' ORDER BY  MATNR ERNAM  MTART MATKL.
    read table itab_new with key MATNR = 'PAINT1'   ERNAM = 'RAMANUM'
    MTART = 'HAWA'   MATKL = 'OFFICE'.
    Code G
    tables: mara, mast.
    data: begin of itab_new occurs 0,
          matnr like mara-matnr,
          ernam like mara-ernam,
          mtart like mara-mtart,
          matkl like mara-matkl,
          end of itab_new.
    select MATNR ERNAM MTART MATKL from mara into table itab_new where
    MTART = 'HAWA' ORDER BY  ERNAM MATKL MATNR MTART.
    read table itab_new with key MATNR = 'PAINT1'   ERNAM = 'RAMANUM'
    MTART = 'HAWA'   MATKL = 'OFFICE'.
    In the above code F, the read statement following the select statement is having the order of the keys as MATNR, ERNAM, MTART, MATKL. So it is less time intensive if the internal table is ordered in the same order as that of the keys in the read statement.
    5. Performance Tuning Using Binary Search
    A very simple but useful method of fine tuning performance of a read statement is using ‘Binary search‘ addition to it. If the internal table consists of more than 20 entries then the traditional linear search method proves to be more time intensive.
    Code H
    select * from mara into corresponding fields of table intab.
    sort intab.     
    read table intab with key matnr = '11530' binary search.
    Code I
    select * from mara into corresponding fields of table intab.
    sort intab.     
    read table intab with key matnr = '11530'.
    Thanks
    Seshu

  • How i can import  MS access Data base in Oracle 9i

    Dear ALL,
    i am feacing problem in import data base from MS ACCESS to Oracle 9i the procedure was very simple in oracle 8.0.5 but dont know what is in Oracle 9i pls i am in big tribble just boz of this problem pls tell me the solution of this prob with brief Steps would be very thank full to you
    Nauman Mirza

    Naumann,
    Have you checked out the Oracle Migration Workbench? You will find a lot of infromation about it here on OTN.
    Donal

  • I want to add image in column is it possible then how to add image in data base what data type we need to do

    I want to add image in column is it possible then how to add image in data base  what data type we need to give we required any casting  please show me one example
    jitendra

    Hi again,
    Several points that can help more:
    1. If you are working with Dot.Net, then I highly recommend read the first link that you got! This is nice and simple coding. Another option is this link which is even better in my opinion:
    http://www.dotnetgallery.com/kb/resource21-How-to-store-and-retrieve-images-from-SQL-server-database-using-aspnet.aspx
    2. As i mention above both link use the column's type image. There are several other option of working with Files. In most of my applications architecture I find that it is better to use a column which let us use any type of file and not an image column.
    In choosing the right column's type for your needs basically your fist question should be if if you want to store your data inside relational database environment or outside relational environment. It is a good idea to look for blogs on this issue. Next
    if you chose to store your data inside then you need to chose the right column type according to your server version. I highly recommend to look for blogs on the differences between those column's types: IMAGE, 
    Check those links:
    To BLOB or Not To BLOB: Large Object Storage in a Database or a Filesystem
    http://research.microsoft.com/apps/pubs/default.aspx?id=64525
    FILESTREAM feature of SQL Server 2008
    http://msdn.microsoft.com/library/hh461480
    FileTables feature of SQL Server 2012
    http://technet.microsoft.com/en-us/library/ff929144.aspx
    Compare Options for Storing Blobs (SQL Server)
    http://technet.microsoft.com/en-us/library/hh403405.aspx
    Binary Large Object (Blob) Data (SQL Server)
    http://technet.microsoft.com/en-us/library/bb895234.aspx
    Managing BLOBs using SQL Server FileStream via EF and WCF streaming
    * Very nice tutorial!
    http://petermeinl.wordpress.com/2012/02/20/managing-blobs-using-sql-server-filestream-via-ef-and-wcf-streaming/
    [Personal Site] [Blog] [Facebook]

  • Regarding Data Base Select Query

    Hi All,
              I want to extract the data from data base into my internal table
              by not giving the exact value but the pattern.
              Ex) I want to select the vendor starting with patter '12*'
                    from LFA table in my internal table.
              Which select Query I should use for getting the
              Vendor No. starting with pattern '12*' ?.
              Points will be rewaded.
              Thanks in Advance.
    With Regards
    Jitendra Gujarathi.

    Hi jitendra,
    1. simple
    2.
    select * from lfa1
    into table lfa1
    where lifnr  like '12%'.
    regards,
    amit m .

  • Using R function on Oracle data base

    for using R, I only can use Oracle data mining algorithms or I can use R function like social network in Oracle data base?

    Oracle Advanced Analytics provides multiple language (SQL, R and if we include GUIs, Oracle Data Miner workflow UI) support to the in-DB analytics. Using SQL, R or the ODM'r GUI, you can access a library of simple descriptive, summary and coparative statistics that have been implemented in the Oracle Database + a dozen hi-perf in-DB data mining algorithms (e.g. regression, decision trees, text mining, clustering, associations, anomaly detection, etc.) and solve a wide range of business and technical problems.
    Should you require additional techniques e.g. R CRAN packages, then Oracle Advanced Analytics supports that through R to SQL transparancy where it "pushes down" R language intentions to matching in-DB SQL functions e.g. ETL, stats and data mining OR it can make a callout to R via "embedded R mode" and have the Database manage the flow of data and the process.
    There is an OTN Discussion Forum that focuses entirely on the "R" aspects of the Oracle Advanced Analytics Option. I suggest that you re-post your questiion here R Technologies for additional discusssions and for the benefit of that Oracle Advanced Analytics/Oracle R Enterprise OTN forum/community.
    cb

  • Data base fields in browse mode

    Appleworks v 6.2.9
    Have data base with 54 fields. List mode fine, but in browse mode
    only first 34 are viewable and therefore available for data entry.
    When tab key is punched after data entered in 34th field cursor goes
    back to 1st field rather than 35th field. Command and down arrow keys
    brings up next record. Is there a keyboard shortcut or any other way
    to enter data in fields 34-54 in browse mode? Using list mode for
    that is too confusing because 1st field identifies record name and
    once past 34th field it is no longer viewable.

    Hi Frank,
    I'm assuming the Layout you are referring to is the default "Layout 1" that AppleWorks creates as you define the fields. This layout, or a "Standard" layout created through the New layout menu item in the Layout menu is a simple list of fields (with labels containing the field name) one above the other in a single column.
    AppleWorks Database Layouts are restricted to a single page in the page size defined in Page Setup (File menu). With the default US Letter size page, at around 34 fields, the list runs into the bottom of the page, and no fields created after that are automatically inserted into the layout.
    You can place more than 34 fields on a page, but you must contribute to the process.
    With Layout 1 (or any other layout you wish to modify) showing, go Layout > Layout to put the document into Layout mode. (You can also do this by pressing shift-command-L.)
    In Layout mode, select one or more of the fields (and labels) at the bottom of the page and drag them up and to the right into some empty space on the layout. New fields inserted onto the layout will be inserted in the space between the bottom-most field and the bottom of the layout/page, so the object of this exercise is to open up enough space at the bottom of your layout to insert the remaining 20 fields. It may take more tthan a single step to do this.
    When you have all 54 fields on the page, rearrange them in the order and in the locations you want.
    Note that the default tab order for a latout is from left to right then top to bottom, starting at the top left. If this order is not suitable, you can override it using the Tab Order... menu item in the Layout menu.
    Regards,
    Barry

  • How to access two oracle data base with out DB link

    Hi,
    I have two data base schema
    one is held in oracle 10g and the other in 11g ,Currently i am using DB link to access both the database. i am accessing around 70 tables using DB link.
    As per new requirement i have to remove DB link ,is there any other way i can access both database with out DB link.
    Thanks,

    malarkandy wrote:
    I have two data base schema
    one is held in oracle 10g and the other in 11g ,Currently i am using DB link to access both the database. i am accessing around 70 tables using DB link.
    As per new requirement i have to remove DB link ,is there any other way i can access both database with out DB link.Yes. But that needs another network and application interface instead of a database link.
    The target database can implement PL/SQL web services. These can be called via HTTP.
    The local database can use UTL_HTTP to make a call to the target database's web service for accessing target database data.
    Both databases can use AQ (Advance Queues). This can be integrated with an application server's JMS queues.
    This enable one database to enqueue a request to the other database, and for that database to respond by sending data.
    There are numerous such type of interfaces that can be used. Some primitive. Some advanced. Some simple. Some complex.
    The easiest and most flexible mechanism is however a database link. And it does not make sense to disallow database links for security and management reasons, but allow JMS for example. The network infrastructure is the same for both methods. The network protocol is the same. The security issues and concerns are the same - except that JMS for example is significantly more moving parts and make configuration and security a lot more complex than using a database link.

  • Data base

    Hi all : Issue is data base  Please attach see file , copy this file to desktop ,, then run create table  vi ,,, as you see its will save the data in access . Please see  I took the this example from national instrument example directory C:\Program Files\National Instruments\LabVIEW 8.5\examples\database  but I add some objects My problems are : 1-       Every one can insert to epos.mdb and do changes 2-       I want if I insert same number in  column 1 , massage appeared that say this number is in data base , and don't saved it , if this number doesn't exist then application will saved it   How can I do that?  thanks       
    Attachments:
    database.zip ‏239 KB

    the exemple just cover the creation of a table, but not the insert record.
    I do not have the database add on but I am using a database not connected yet to Labview.
    To answer your question you should first use create table with the database app(like access: simpler)
                    next find the function vi to (findRecord(like query)  and Numberof record  and insert record. 

  • Can you use SQL Developer against non Oracle data bases?

    If so, then how do you define the connection for non Oracle data bases?

    Look, SQL Developer has got to be a 'gateway' into Oracle DBs from other databases. JDBC allows simple introspection and execution of SQL commands. So the 'explain' button won't be available, or some of the DDL stuff, big deal! Let them get a taste of what they are missing by not having an Oracle database.
    If we can get non-Oracle developers (especially MS SQL Server) to use SQL Developer it will expose them to the superiority of the Oracle DB server.
    If they have heterogenous services installed they are already an Oracle customer -- we have little additional DB server sale opportunity there. SQL Developer is a really sweet tool and it could be a real draw into the DB server sales.
    SQL Developer must be easily usable by non-Oracle customers in order to help us sell the DB server to them!

  • EJB- data base connectiviy:

    we used Jdeveloper 3.0 to develop a Simple EJB object using the wizard.
    we have also deployed the same in the oracle 8i data base(8.1.5).
    there were no errors during deployment.
    we used jdk 1.1.8 option for developing EJB objects.
    we have also created a EJB client using JDveloper Wizard.
    client is also working fine when we invoke the EJB object .
    In our bean class we are using JDBC calls for validation:
    we used the following code in the bean class in our method for getting connection:
    Connection conn = new oracle.jdbc.driver.OracleDriver().defalutConnection();
    with this connection we executed JDBC calls.
    the client is able to establish a data base connection .and able to invoke our bean method also.
    Here the data base to which we connect is same where we deployed our EJB object.
    (the deployement and JDBC calls are made to the same data base )
    Now we try to use the following code for connecting to the data base other than where we deployed the EJB object.
    The data base from where we try to establish data base conncection is oracle 8.0.4 . (for business logic )
    we use the following code in our bean class for the data base connection
    Class.forName("oracle.jdbc.driver.OracleDriver");
    String url = "jdbc:oracle:thin:@192.168.1.99:1521:orcl"
    Connection conn = DriverManager.getConnection( url,"pilotjava","insyst");
    when we run the clinet it is giving following error message
    "D:\Oracle\JDeveloper\java\bin\javaw.exe" -classpath "D:\Oracle\JDeveloper\lib\jbotester.zip;D:\Oracle\JDeveloper\lib\jbodatum.zip;D:\Oracle\JDeveloper\lib\jbomt.zip;D:\Oracle\JDeveloper\lib\jboremote.zip;D:\Oracle\JDeveloper\lib\jnd i.jar;D:\Oracle\JDeveloper\lib\xmlparserv2.jar;D:\Oracle\JDeveloper\myclasses;D:\Oracle\JDeveloper\lib\jdev-rt.zip;D:\Oracle\JDeveloper\jdbc\lib\oracle8.1.5\classes111.zip;D:\Oracl e\JDeveloper\lib\connectionmanager.zip;D:\Oracle\JDeveloper\lib\jbodatum.zip;D:\Oracle\JDeveloper\lib\jbomt.zip;D:\Oracle\JDeveloper\lib\jboremote.zip;D:\Oracle\JDeveloper\lib\jndi .jar;D:\Oracle\JDeveloper\lib\xmlparserv2.jar;D:\Oracle\JDeveloper\myprojects\mayur;D:\Oracle\JDeveloper\lib\jbohtml.zip;D:\Oracle\JDeveloper\lib\jboremoteejb.zip;D:\Oracle\JDevelo per\aurora\lib\aurora_client.jar;D:\Oracle\JDeveloper\aurora\lib\vbjorb.jar;D:\Oracle\JDeveloper\aurora\lib\vbjapp.jar;D:\Oracle\JDeveloper\lib\javax_ejb.zip;D:\Oracle\JDeveloper\l ib\jboo8i.zip;D:\Oracle\JDeveloper\jswdk-1.0\lib\servlet.jar;D:\Oracle\JDeveloper\lib\ojsprun.jar;D:\Oracle\JDeveloper\myprojects\WebApp6;D:\Oracle\JDeveloper\aurora\lib\aurora_cli ent.jar;D:\Oracle\JDeveloper\aurora\lib\vbjorb.jar;D:\Oracle\JDeveloper\aurora\lib\vbjapp.jar;D:\Oracle\JDeveloper\aurora\lib\vbjtools.jar;D:\Oracle\JDeveloper\aurora\lib\vbj30ssl. jar;D:\Oracle\JDeveloper\myprojects\MrSource1.jar;D:\Oracle\JDeveloper\myprojects\MrGenerated1.jar;D:\Oracle\JDeveloper\myprojects\MyEJBmaytestRSource1.jar;D:\Oracle\JDeveloper\myp rojects\MyEJBmaytestRGenerated1.jar;D:\Oracle\JDeveloper\java\lib\classes.zip;D:\Oracle\JDeveloper\jfc\lib\swingall.jar" oracle.jbo.jbotester.MainFrame -M Local -C "jdbc:oracle:thin:pilotjava/[email protected]:1521:ORCL" -T AppModule -N mayur.AppModule -H "D:\Oracle\JDeveloper\doc"
    AppAccelerator(tm) 1.1.8 for Java (JDK 1.1), x86 version.
    Copyright (c) 1997-1998 Borland International. All Rights Reserved.
    Copyright (c) 1997-1999 Oracle Corporation. All Rights Reserved.
    Diagnostics: Silencing all diagnostic output (use -Djbo.debugoutput=console to see it)
    Creating an initial context
    Looking for the EJB published as 'test/MyEJBmaytestR'
    Creating a new EJB instance
    thge value is mayur.JomItemViewImpl@1ec343
    Error is java.sql.SQLException: No suitable Driver
    OracleDriver.connect
    where mayur.JomItemViewImpl@1ec343 is the Object referece of the bean class -> beanclass.toStirng()
    please suggest us solution for our problem.
    advance thanks for your help.
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by JDev Team:
    You cannot connect thru OCI drivers. Not sure about the global database names. You can check in the documentation available on the OTN
    thanks and best regards
    raghu<HR></BLOCKQUOTE>
    Dear Raghu/Laura,
    Thanks for your reply .
    we tried, as per your sugession, creating a DB link to the other data base,
    it is not working out. we get following error ,when we run the client.
    OUR DBLINK NAME IS : ORACLE.WORLD.
    "D:\JDEV3.0\java\bin\javaw.exe" -mx50m -classpath
    projects\varaEJBSource.jar;D:\JDEV3.0\java\lib\classes.zip" varaganEJB.varaganEJBJSClient
    Creating an initial context
    Looking for the EJB published as 'test/varaganEJB'
    Creating a new EJB instance
    Calling varaganEJB.varaEJB methods...
    ...done!varagan
    error during invoke ejbnull
    javax.jts.HeuristicRollbackException
    when we tried to call the tables of the same database it is working fine .
    we have tested the database link , by calling the same Sql statement using
    oracle 8i client (SQL) , it is working fine.
    Following is the source code of us: Pl go thru and suggest us.
    NOTE: I HAVE REMOVED THE SOME OF THE DEFALUT CODES GEN BY JD.....(BUT FOR THE NAMES)
    TO REDUCE UNNECESSARY INFO.
    REMOTE:
    public interface varaEJB extends EJBObject {
    public java.lang.String getEname(int empno) throws java.rmi.RemoteException;
    public java.lang.String getmyName() throws java.rmi.RemoteException;
    HOME:
    varaEJB create() throws java.rmi.RemoteException, javax.ejb.CreateException;
    BEANCLASS:
    public class varaEJBClass implements SessionBean {
    public String getmyName() throws RemoteException{
    return "varagan";
    public String getEname(int empno) throws RemoteException{
    // String sql = "select ename from emp where empno = ?";
    String sql1 = "select item_name from [email protected] where item_code = ?" ;
    try {
    Connection connect = new oracle.jdbc.driver.OracleDriver().defaultConnection() ;
    System.out.println("connected");
    PreparedStatement ps = connect.prepareStatement(sql);
    System.out.println("statement prepared");
    ps.setString(1,"FAB7022050");
    // ps.setInt(1,empno);
    ResultSet rs = ps.executeQuery();
    if (rs.next())
    return rs.getString(1);
    else
    return "No record for this emp number";
    }catch(Exception ex){
    System.out.println("error occurred druing sql "+ex);
    return ex.getMessage();
    }// getename
    CLIENT CODE:
    public class varaganEJBJSClient {
    public static void main(String[] args) {
    String ejbUrl = "sess_iiop://192.168.1.24:2481:ORCL/test/varaganEJB";
    String username = "scott";
    String password = "tiger";
    // Setup the environment
    Hashtable environment = new Hashtable();
    // Tell JNDI to speak sess_iiop
    environment.put(javax.naming.Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
    // Tell sess_iiop who the user is
    environment.put(Context.SECURITY_PRINCIPAL, username);
    // Tell sess_iiop what the password is
    environment.put(Context.SECURITY_CREDENTIALS, password);
    // Tell sess_iiop to use credential authentication
    environment.put(Context.SECURITY_AUTHENTICATION, ServiceCtx.NON_SSL_LOGIN);
    // Lookup the URL
    varaganEJB.varaEJBHome homeInterface = null;
    try {
    System.out.println("Creating an initial context");
    Context ic = new InitialContext(environment);
    System.out.println("Looking for the EJB published as 'test/varaganEJB'");
    homeInterface = (varaganEJB.varaEJBHome) ic.lookup(ejbUrl);
    catch (ActivationException e) {
    System.out.println("Unable to activate : " + e.getMessage());
    e.printStackTrace();
    System.exit(1);
    catch (CommunicationException e) {
    System.out.println("Unable to connect: " + ejbUrl);
    e.printStackTrace();
    System.exit(1);
    catch (NamingException e) {
    System.out.println("Exception occurred!");
    System.out.println("Cause: This may be an unknown URL, or some" +
    " classes required by the EJB are missing from your classpath.");
    System.out.println("Suggestion: Check the components of the URL," +
    " and make sure your project includes a library containing the" +
    " EJB .jar files generated by the deployment utility.");
    e.printStackTrace();
    System.exit(1);
    // That's it!
    try {
    System.out.println("Creating a new EJB instance");
    varaganEJB.varaEJB remoteInterface = homeInterface.create();
    System.out.println("Calling varaganEJB.varaEJB methods...\n");
    // Method calls go here!
    // e.g.
    // System.out.println(remoteInterface.foo());
    System.out.println("...done!"+remoteInterface.getmyName());
    System.out.println("employee name is : "+remoteInterface.getEname(7839));
    catch (Exception e) {
    System.out.println("error during invoke ejb"+e.getMessage());
    e.printStackTrace();
    PLEASE SUGESST US.
    WE HAVE ANOTHER DOUBT ,RELATED TO DBLINK,;
    WE ARE NOT ABLE TO CREATE A DB LINK OF OUR OWN NAME , THE NAME MUST BE "ORACLE.WORLD".
    WHAT IS THE LOGIC BEHIND?
    ANY PARAMETER TO BE SET UP SEPARTELY?
    null

Maybe you are looking for