Simple java class for SQL like table?

Dear Experts,
I'm hoping that the java people here at the Oracle forums will be able to help me.
I've worked with Oracle and SQL since the 90s.
Lately, I'm learning java and doing a little project in my spare time. 
It's stand alone on the desktop.
The program does not connect to any database 
(and a database is not an option).
Currently, I'm working on a module for AI and decision making.
I like the idea of a table in memory.
Table/data structure with Row and columns.
And the functionality of:
Select, insert, update, delete.
I've been looking at the AbstractTableModel.
Some of the best examples I've found online (they actually compile and work) are:
http://www.java2s.com/Code/Java/Swing-JFC/extendsAbstractTableModeltocreatecustommodel.htm
http://tutiez.com/simple-jtable-example-using-abstracttablemodel.html
Although they are rather confusing.
In all the examples I find, there always seems to be
at least three layers of objects:
Data object (full of get/set methods)
AbstractTableModel
GUI (JFrame, JTable) (GUI aspect I don't need or want)
In all the cases I've seen online, I have yet to see an example
that has the equivalent of Delete or Insert.
Just like in SQL, I want to define a table with columns.
Insert some rows. Update. Select. Delete.
Question:
Is there a better java class to work with?
Better, in terms of simpler.
And, being able to do all the basic SQL like functions.
Thanks a lot!

Hi Timo,
Thanks. yes I had gone thru the java doc already and  they have mentioned to use java.sql.Struct, but the code which got generated calls constructor of oracle.jpub.runtime.MutableStruct where it expects oracle.sql.STRUCT and not the java.sql.STRUCT and no other constructor available to call the new implementation and that is the reason i sought for some clues.
  protected ORAData create(CmnAxnRecT o, Datum d, int sqlType) throws SQLException
    if (d == null) return null;
    if (o == null) o = new CmnAxnRecT();
    o._struct = new MutableStruct((STRUCT) d, _sqlType, _factory);
    return o;
here CmnAxnRecT is the class name of the generated java class for sqlType.
Thanks again. Please let me know if you have any more clues.
Regards,
Vinothgan AS

Similar Messages

  • How to Run a .sql file from simple java class

    How to execute a .sql file consisting of Complex Queries,procedures through simple java class.
    The queries may have different delimiters,queries independant of each other.
    I am able to do with Specific De-limiter.But I need in such a way that there should not be any
    Constraints. Since My .sql may Contain different De-limiters.
    If any one can Suggest Some Solution.
    It will be Great Help.
    regards
    Anil

    Check out ibatis script runner, it' a third party library but quite handy for running sql files...
    m

  • Java extension for SQL Developer 2.1 (SqlEditor)

    Hello,
    we are developing a java extension for SQL Developer. It was working fine in version 1.5.5 but it seems that some of the java classes were changed in version 2.1 so it does not any more. In the SQL editor, we want to have a context menu action that gets the selected SQL statement and calls a database function with it as an argument. Our code looks like
    @RegisteredByExtension("our.developer.extension")
    public final class OurCommand extends Command {
    public int doit() {
    SqlEditor sqlEditor = (SqlEditor)getContext().getView();
    String query = sqlEditor.getView().getSqlStatement();
    sqlEditor.executeSql(query, "");
    //or
    //sqlEditor.getView().scriptRunner(query);
    Unforunately, in SQL Developer 2.1 the class oracle.dbtools.sqlworksheet.sqlview.SqlEditor does not exist. Does anybody know how to write this example for version 2.1? Is there an API documentation (alas, [http://wiki.oracle.com/page/SDK+2.0] is an empty article)?
    BTW, does anybody know how to open the dialog for connecting to a database when sqlEditor.getConnection() is null?

    I got it to work using a BASIC call instead of my normal TNS call.
    We use MS SMS to package the Oracle client and SQL Developer and push it out to users so we don't have people visiting desktops. Also, we use OID to store the entries instead of a tnsnames file so that we don't have to maintain a TNSNAMES file.
    I am testing 2.1 as we would eventually upgrade when it goes GA.
    2.1 seems to be built on Oracle 11g. Issue will be that since 99% of our databases are 10gr2 as well as 100% of our client population will be be forced to upgrade the Oracle client to use 2.1 as we do today without lots of changes for the end user?
    We don't broadcast the information the average user requires for a BASIC connection so that is out for non technical users..
    We have SQL Developer 1.5.5 right now and this is not and issue.
    Hopefully, this will be resolved during EAI for 2.1.

  • Simple Java class using SQLJ not compiling.

    Hello all, I have a simple Java class that is using SQLJ. It will not compile though. I am not sure what I should set for classpath. Any ideas? This is what I have so far.
    set PATH=C:\jdk1.2.2\bin;c:\oracle\ora81\jdbc\bin;
    set CLASSPATH="C:\oracle\ora81\jdbc\lib\classes12.zip;C:\oracle\ora81\sqlj\lib\runtime12.zip;C:\oracle\ora81\sqlj\lib\translator.zip;C:\jdk1.2.2\lib\*.*"
    then
    javac SQLJTester.java
    Here is my .java file ---
    import java.io.*;
    import java.sql.*;
    import sqlj.runtime.*;
    import sqlj.runtime.ref.*;
    public class SQLJTester {
    public static void update() throws Exception {
    java.sql.Timestamp timeNow;
    #sql {
    BEGIN
    :timeNow := sysdate;
    END
    public static void main (String[] args) {
    try {
    SQLJTester.update();
    System.out.println ("Updated successfully");
    catch (Exception e) {
    System.out.println ("Caught an exception.");
    Thanks ahead for your time,
    Justin

    When sqlj files are compiled and translted to java file with them the file with extension .ser is also generated. browsers do not recognise this .ser files they only understand .class files which the download using <codebase> instead of class path. so thats why you r not able to use sqlj in servlet. try to customize the profile. Now can some one inform how to use sqlj from eclipse. does it support?. i need to downoad sqlj.exe for that. if anyone has idea from where i can download sqlj.exe pls inform me at [email protected]

  • Replicating simple Java objects for automatic failover

    Is there a way to replicate a simple java object that is bound from JNDI
              across all servers so that if the primary server fails, it will
              automatically failover?
              We have a java client that uses JNDI to access EJBs on WLS5.1 SP8. In order
              to determine client information, the client currently binds a simple java
              class in the JNDI tree. The Entity and Session beans use the caller
              principal to locate the object in order to access client-information for
              such things as record locking, logging, etc..
              We have to move this architecture to a cluster environment and we are
              wondering how we can replicate this object across cluster servers so that
              failover is handled automatically, and that it is still accessible through
              JNDI.
              An RMI replicated stub is not enough, since it only works as long as the
              server hosting the RMI object is alive.
              I'd like to add that the object is created and bound at client start-up and
              destroyed at client exit.
              Thank you for any advice or information,
              Dania Kodeih.
              

    A: Replicating simple Java objects for automatic failover

    That's what I figured. I guess the only solution in this case is to persist
              the object during client sessions. I was hoping for something simpler, but I
              guess I'll have to create an Entity Bean and everything else that comes with
              it.
              Thanks,
              Dania.
              Cameron Purdy wrote in message <[email protected]>...
              >Unfortunately, when the originating server goes down, the replicated object
              >disappears.
              >
              >Peace,
              >
              >--
              >Cameron Purdy
              >Tangosol, Inc.
              >http://www.tangosol.com
              >+1.617.623.5782
              >WebLogic Consulting Available
              >
              >
              >"Don Ferguson" <[email protected]> wrote in message
              >news:[email protected]..
              >> If I am not mistaken, any serializable object will automatically be
              >replicated
              >> across the tree.
              >>
              >> Dania Kodeih wrote:
              >>
              >> > Is there a way to replicate a simple java object that is bound from
              JNDI
              >> > across all servers so that if the primary server fails, it will
              >> > automatically failover?
              >> >
              >> > We have a java client that uses JNDI to access EJBs on WLS5.1 SP8. In
              >order
              >> > to determine client information, the client currently binds a simple
              >java
              >> > class in the JNDI tree. The Entity and Session beans use the caller
              >> > principal to locate the object in order to access client-information
        �... [Show more]

    Read other 4 answers

  • Web Services - Simple Java Classes

    Hi folks,
    I'm new to using Netweaver and web services in general. I have some existing simple java classes already that I want to convert to a web service. I've decided to try and do a simple test first to make sure I understood how to do this correctly so I followed the steps outlined in this link: (I find I understand this better than the other help files)
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60046fb9-ac5b-2910-08a6-b7b04b463c62">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60046fb9-ac5b-2910-08a6-b7b04b463c62</a>
    In the end what I got was a class file that has been turned into webservices (the code has @WebService, etc). When I try to do a deployment, everything goes well but I'm not quite sure which link I should use to check out my WSDL or anything. I tried the link like in the article above (but used http://localhost:50000 instead) and wound up getting a 404 error. Is there something I'm doing wrong?
    Also, as a quick follow up...since the link shows steps on building EJB's for web services, is it correct to assume that I can use the same steps when building simple java classes? (Create project --> Java Project, create my methods/classes, create new webserive and put slider to Test to check if everything works).
    Any help with this will be greatly appreciated I've been trying to figure this out for days already.

    Hi Bianca,
    Welcome on SDN!
    Have you tried to follow the steps exactly as described in the above document? That is, move the slider to "Develop service", then deploy your application, and request http://localhost:50000/HelloWorldBeanService/HelloWorldBean?wsdl - this worked fine for me.
    > I find I understand this better than the other help files
    Well, which help files you use depends on which version of the NetWeaver AS Java you're using. The link above is applicable to the Java EE 5 preview version; the help files you're probably referencing are the official documentation of the NetWeaver 04 and 04s releases.
    Hope it helps!
    -Vladimir

  • How do I call a simple java class from a bpel process?

    Hi.
    In JDeveloper 10.1.4.3.0 I've created a simple java class that does an ftp get operation followed by an unzip. The class uses some 3rd part libraries (jars).
    I want to use a simple bpel process to schedule a daily execution of this java class, and deploy it all to our SOA-server, - and was looking into using the <bpelx:exec> function.
    The java class and the bpel process is all stored in the same JDeveloper project.
    How do I put this together so that both my java class and the necessary jars are available to the bpel process?
    I've looked into the JavaExecSample.bpel, and it's says something about "...the class com.otn.samples.javaexec.CreditCalculator is locally packaged with this BPEL process".
    How do I do that?
    Can I make it and test it all locally from my workstation (only JDeveloper installed, I guess there's nothing that can execute the bpel code?), or do I have to compile class etc (make war-file?) and deploy to SOA server (BPEL-INF/lib or classes?) before anything can be tested?
    (I guess all this is simple, once you know how, but being a newbie to this I need a shove in the right direction :-)
    Regards,
    -Haakon-

    To create a java class and dependent jars inside the BPEL process project you need to do the following:
    1. Right click on your BPEL process project and select New and then Java Class from the Items.
    2. Make the BPEL process project, JDeveloper would compile the java classes and add them into the BPEL suite case jar, see the output folder and check the BPEL suite case jar file for java classes and dependent jars.
    You can test your Java classes from JDeveloper IDE, no need to deploy the classes on SOA server. When you make the BPEL project it compiles .bpel files and Java classes. You can test your classes once .bpel file and java classes compiled successfully.
    Regards,
    Dharmendra
    http://soa-howto.blogspot.com

  • Securing Web Services based on simple Java Classes

    Hi @all!
    We`ve got the following problem.
    There`s a .NET client calling our Web services deployed on Bea Weblogic 8.1 (without
    SP).
    The Web Services are generated by the ANT task servicegen. They are based on simple
    Java classes containing the service methods as public members.
    Is there a possibility to secure these methods without using the console menu
    item "Define Security Policy" ?
    We can`t use this menu because it has got a javascript bug with methods returning
    an array.
    Thanks in advance for help.
    Michael

    Hi Michael,
    Could you use transport level security, SSL [1]?
    I'm not sure what limitation you are experiencing with the console? Is
    there a traceback? Have you contacted customer support on this issue?
    Thanks,
    Bruce
    [1]
    http://edocs.bea.com/wls/docs81/webserv/security.html#1053203
    Michael Albrecht wrote:
    >
    Hi @all!
    We`ve got the following problem.
    There`s a .NET client calling our Web services deployed on Bea Weblogic 8.1 (without
    SP).
    The Web Services are generated by the ANT task servicegen. They are based on simple
    Java classes containing the service methods as public members.
    Is there a possibility to secure these methods without using the console menu
    item "Define Security Policy" ?
    We can`t use this menu because it has got a javascript bug with methods returning
    an array.
    Thanks in advance for help.
    Michael

  • Generic Java class for working with Context Nodes

    Hi,all
    I would like to write generic Java class for working with Context Nodes:
    populating node,
    add element to node,
    update node element,
    remove node element
    Any ideas how can I do it?

    Hi,Armin
    Thanks for your answer.
    I have many nodes with the same structure,but different data.
    I don't want to work with each one of them individually.
    This is the main reason.
    Regards,
    Michael
    Any ideas?

  • Re: Using simple java class in an .war file.

    Hi All,
    I have a simple question,
    Can I access an simple java class from a jsp file that I have written by putting it in the "classes" folder?? What entry should go in the web.xml file?
    Here is my directory structure:
    sample.war
    |
    ----test.jsp <file>
    |
    ----WEB-INF <folder>
    | |
    | ----classes<folder>
    | | |
    | | ----simpleJavaClass.class<file>
    | |
    | ----lib<folder>
    | |
    | ----web.xml
    I want to access the simpleJavaClass.class from the jsp test.jsp.
    Please suggest.
    Thanks and regards
    Ayusman

    It is possible to access the class in u r classes folder from u r jsp file.
    For example
    <%@ page import="com.test.service.PricingSolution,
    com.test.core.PhoneNumber
    %>
    <% PricingSolution solution = (PricingSolution)session.getAttribute("solution"); %>
    This is a simple scriplet example. You do the same using jstl tags also.
    --Shinoy

  • How to pass a HTTP request from a simple java class

    Is it possible to pass an HTTP request from a simple java class.if yes how?

    Is it possible to pass an HTTP request from a simple
    java class.if yes how?If you're talking about creating a HttpRequest object and passing it to a servlet, that would be a red flag to me that your design is flawed. You shouldn't have to do that - the application server (Tomcat, Weblogic, etc) should be the only thing that has to worry about creating that kind of object and passing it to you.

  • How to  get the profile object in simple java class  (Property accessor)

    Hi All,
    Please guide me how to get the profile object in simple java class (Property accessor) which is extending the RepositoryPropertyDescriptor.
    I have one requirement where i need the profile object i.e i have store id which is tied to profile .so i need the profile object in the property accessor of the SKU item descriptor property, which is extending RepositoryPropertyDescriptor.
    a.I dont have request object also to do request.resolvename.
    b.It is not a component to create setter and getter.It is simple java class which is extending the RepositoryPropertyDescriptor.
    Advance Thanks.

    Iam afraid you might run into synchronization issues with it. You are trying to get/set value of property of a sku repository item that is shared across various profiles.
    Say one profile A called setPropertyValue("propertyName", value).Now another profile B accesses
    getPropertyValue() {
    super.getPropertyValue() // Chance of getting value set by Profile A.
    // Perform logic
    There is a chance that profile B getting the value set by Profile A and hence inconsistency.
    How about doing this way??
    Create PropertyDescriptor in Profile (i.e user item descriptor), pass the attribute CustomCatalogTools in userProfile.xml to that property.
    <attribute name="catalogTools" value="atg.commerce.catalog.CustomCatalogTools"/>
    getPropertyValue()
    //You have Profile item descriptor and also storeId property value.
    // Use CustomCatalogTools.findSku();
    // Use storeId, profile repository item, sku repository item to perform the logic
    Here user itemdescriptor getPropertyValue/setPropertyValue is always called by same profile and there is consistency.
    -karthik

  • How to create object class for a z table

    Hi All,
    I have a z table and I want to register the changes of fields should be logged to CDHDR and CDPOS table.
    Is this possible?
    If yes how can I creat an object class for a z table. I have already checked the change document option in z data element.
    Please help.
    Regards,
    Jeetu
    Moderator message: standard functionality, please search for available information/documentation before asking.
    locked by: Thomas Zloch on Oct 6, 2010 6:16 PM

    Tcode SCDO. You'll need to create a change document for you Z table and then use the FM created to record the changed data.

  • InterMedia Java Classes for Servlets and JSPs and Netscape

    I am using the interMedia Java Classes for Servlets and JSPs to upload and retrieve multimedia data. I have found that it is much more performant in Internet Explorer (5.5) than in Netscape Communicator (4.7). In fact, I cannot upload images larger than 10K at all using netscape. However, the same image can be uploaded into the same application using IE. Is this a known issue?
    Thanks in advance.

    Hi,
    We have successfully uploaded multimedia data in the giga-byte range (Quicktime and AVI files) at the same speed with both the Netscape (4.7n) and MS IE (4.n and 5.n) browsers. One thing we have noticed is that its very important to set the manual proxy settings correctly if you have an environment with a proxy server. If you don't, then uploads can go via the proxy server and, for some reason, that seems to take considerably longer. For example, suppose you are in the www.xyzco.com domain and are connecting to a host named webserver.www.xyzco.com, then specify webserver and webserver.www.xyzco.com (to cover both cases) in the "Do not use proxy servers for..." box in the manual proxy server configuration screen. Also, if you're using a tool such as JDeveloper that uses the host IP address in the debugger environment, then you also need to add the numeric-based (nnn.nnn.nnn.nnn) IP address to this list.
    Hope this helps.
    In order to better understand the variety of ways in which our customers are using interMedia, we'd be very interested in knowing a little more about your application, the interMedia functionality that you are using, and how you are developing and deploying your application. If you are able to help us, please send a short email message with some information about your application, together with any comments you may have, to the Oracle interMedia Product Manager, Joe Mauro, at [email protected] Thank you!
    Regards,
    Simon
    null

  • JAXB to generate java classes for XSD.

    Hi
    I have a XSD, which is importing other couple of xsds in it, tried to generate java classes using xjc, it is throwing error.
    C:\vittal\Project\received\development-1\da_xsd>xjc -p com daAuthoring.xsd
    parsing a schema...
    [ERROR] Property "Alt" is already defined. Use <jaxb:property> to resolve thi
    s conflict.
      line 42 of file:/C:/vittal/Project/received/development-1/da_xsd/commonElement
    s.xsd
    [ERROR] The following location is relevant to the above error
      line 2205 of file:/C:/vittal/Project/received/development-1/da_xsd/daCommonEle
    ments.xsd
    Failed to parse a schema.Please let me know how to fix this issue.

    Thanks for information,
    I do understand xml well, and having basic knowledge on XSD.
    1. can i generate a java classes for a xsd which is including other XSDs.
    2. how to overwrite the issue, using annotation, point me to a location where i will get more information, that will be great help.
    here is my xsd.
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" xmlns:dctm="http://www.documentum.com" elementFormDefault="qualified">
         <xs:import namespace="http://dita.oasis-open.org/architecture/2005/" schemaLocation="ditaarch.xsd"/>
         <xs:import namespace="http://www.documentum.com" schemaLocation="dctmAttrs.ent.xsd"/>
         <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
         <xs:group name="alt">
              <xs:sequence>
                   <xs:element ref="alt"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="desc">
              <xs:sequence>
                   <xs:element ref="desc"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="title">
              <xs:sequence>
                   <xs:element ref="title"/>
              </xs:sequence>
         </xs:group>
         <!-- Elements in tblDecl.mod -->
         <xs:group name="colspec">
              <xs:sequence>
                   <xs:element ref="colspec"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="entry">
              <xs:sequence>
                   <xs:element ref="entry"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="row">
              <xs:sequence>
                   <xs:element ref="row"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="tbody">
              <xs:sequence>
                   <xs:element ref="tbody"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="tgroup">
              <xs:sequence>
                   <xs:element ref="tgroup"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="thead">
              <xs:sequence>
                   <xs:element ref="thead"/>
              </xs:sequence>
         </xs:group>
    </xs:schema>

Maybe you are looking for

  • Can I have 2 apple ID on one computer

    Can I have 2 iTune accounts on one computer

  • Using OCI with Oracle RDB V7.0.3

    We will shortly be upgrading our RDB installation under OpenVMS (Alpha) to version 7.0.3 of RDB, running on version 7.2 OpenVMS. Q1) Will it be possible to use the 'Oracle Call Interface' or OCI with this version of RDB. If so, what extra software co

  • Checkbox - not working for multiple selected values

    Hi, I've got a checkbox (with multiple static values) and a dynamic report which displays filtered data based on the checkbox selection... my report refreshes correctly for a single checkbox selection, but when I select multiple values it gives me an

  • Shutting down macbook pro

    The shutting down of my macbook at times is hanging or takes long ever since I upgraded the operating system to Lion. I am forced to hold down the on button for some seconds to shut it down manually. What could be the course of this?

  • Error on schedule.aspx after upgrade from 2007

    Hi, i am upgrading from 2007 to 2013. Everything is fine exept i am having 2 issues : - i can't access (tried as admin and as project manager) the Schedule.aspx page i am getting the following message "you do not have sufficient permissions to view t