The ResultSet.class file

Hi,
I am also having similar problems with ResultSet class. I would like the ResultSet.class file that you sent to Ashish. It would help me solve my problem very quickly. Could you sent it to me as an attachment in an email.
Thanks in advance,
Jason Mitchell

stmt.executeQuery(query) will return a resultset, you are asking for an int.
resultset contains the details of the executed statement AFAIK. Bit new to this but the way I would do it is as follows:
try{
            // Step 1: Load the JDBC driver.
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            // Step 2: Establish the connection to the database.
            String url = "jdbc:odbc:shop";
            conn = DriverManager.getConnection(url);
            System.out.println("Connected to shop database");
            catch(Exception e){
            System.err.println("Got an exception! ");
            System.err.println(e.getMessage());
            System.out.println("Suggestion: Perhaps your database cannot be found");
        }And then to insert data I would do this, use another try catch block, that way if there is an exception u will know it is not related to database connectivity.
PreparedStatement pstmt = null;
            ResultSet rs = null;
            pstmt = conn.prepareStatement("INSERT INTO User (lastname,firstname) " +
          "values ('" + lastname + "', " +
          "'" + firstname + "')";
            pstmt.execute();Oh and declare conn somewhere;
private Connection conn; //Database connection
I hope this has helped
Message was edited by:
TheSniipe

Similar Messages

  • How to read the java class file to convert it in java.

    hello all,
    i m developing the java application which generated the java code from the java 'class file' .
    Can anybody please help me, Is any java support for reading the class file? or how to know the class file format?
    I know the application javad, jad, javap which is doing the same thing.
    thanks for reply,
    - Jayd

    do you mean decompiling? there are tons of java decompilers available out there, what exactly are you trying to do here?

  • Where to keep the java class file which is being used from a form?

    Hi,
    Actually I am developing a form which has a bean area and the data will be displayed in the bean area in the form of grid. And I will register this form with apps and will run the from Oracle apps. I want to know that there is a java class file that is being refered by the form, where should this java class file be placed and is there any other places where any changes are required so that the form runs correctly from the Oracle apps and can find the java class file.
    I am very thankful to each and everyone who will be able answer this question of my.

    do you mean decompiling? there are tons of java decompilers available out there, what exactly are you trying to do here?

  • The ResultSet class is not very convenient to use

    Often we need to know how many rows have been retrieved from the database before we read each row's data in order to do preparation works such as allocate appropriate memories to store the data.The ResultSet class in java.sql package does not provide a function to retrieve the total rows read from the database. We must do the follow to get the count of rows:
    ResultSet rs;
    rs.last();
    int lastrow = rs.getRow();
    rs.first();
    int firstrow = rs.getRow();
    int rows = lastrow - firstrow + 1;
    String [] data = new String[rows];
    // retrieve each row's data into the string array
    It would be much more convenient if the class can provide a function like:
    rs.getRows();

    Often we need to know how many rows have been
    retrieved from the database before we read each row's
    data in order to do preparation works such as allocate
    appropriate memories to store the data.But then we learn a little bit of Java and realize we can add the rows to a List (such as an ArrayList) without having to know that number in advance.

  • Error: "Could not find the main class: Files\NetBeans"

    I am working on a WorldWind mapping application but I think this issue is more of a straight Java question. I was attempting to add a web service reference by means of the NetBeans IDE. The reference compiled as it should have but then the application would not run. I deleted the reference, commented out all the code that used the web reference, basically restored all the code to how it was before trying to add the web service. The applicaiton still will not run with the message that it can't find the main class. I do, however, get a clean build. What should I do to fix this?
    Here is the error: "Could not find the main class: Files\NetBeans"
    thanks!

    nigel25840 wrote:
    I am working on a WorldWind mapping application but I think this issue is more of a straight Java question. I was attempting to add a web service reference by means of the NetBeans IDE. The reference compiled as it should have but then the application would not run. I deleted the reference, commented out all the code that used the web reference, basically restored all the code to how it was before trying to add the web service. The applicaiton still will not run with the message that it can't find the main class. I do, however, get a clean build. What should I do to fix this?
    Here is the error: "Could not find the main class: Files\NetBeans"
    thanks!Sounds like something (a .cmd file or .bat file, perhaps) is set up to launch NetBeans with a command line like this:
    java -classpath ... c:\Program Files\NetBeans ...
    So since the path has embedded space(s) in it, it thinks you are wanting to run a class named "Files\NetBeans", which does not exist.
    You need someone there who knows what they are doing to look into it for you.

  • How can i access the methods if i only got the java class file?

    just like what the topic said...i would like to ask if i only got the class file of java without API documentation. how can i know what method is included ?
    thanks a lot.
    my email address is : [email protected]

    Class.getMethods()
    throws SecurityException
    Returns an array containing Method objects reflecting all the public member methods of the class or interface represented by this Class object, including those declared by the class or interface and and those inherited from superclasses and superinterfaces. The elements in the array returned are not sorted and are not in any particular order. This method returns an array of length 0 if this Class object represents a class or interface that has no public member methods, or if this Class object represents an array class, primitive type, or void.

  • Getting the class name from within the compiled class file

    hey!
    I was wondering (i know its possible) how to read a .class and get the name of the class. ok that made not much sense^^ so, You have a file: c:\f.class but it wont run because the file name has to be the same as the classes name, right? so how can you read the class file i guess in binary mode to receive the correct class name.
    I saw inside my f.class i have "realname.java" so i know now that the name of the class file should be realname.class, i tried ways to extract it from the class file but never had any success.
    i think i need to study english^^
    ps: i need this because i have some class files sent to me and the file names have been changed so they wont work, they only work when i open the class file in notepad and find out what its real name should be and then rename the file.
    Edited by: forgotmydamnpass on May 7, 2009 11:23 AM

    ah looks interesting, problem is i cant use it.. im prone to errors!
    import java.net.URLClassLoader;
    public class NewMain {
         * @param args the command line arguments
        public static void main(String[] args) {
            FileClassLoader loader = new FileClassLoader();
            Class clazz = loader.createclass("c:\\f.class");
            Method method = clazz.getName();
    }apparently "createclass" doesnt exist :/
    FileClassLoader = cannot find symbol
    Method = cannot find symbol

  • Determine the Java Class File Major & Minor Version

    Did anyone tried to look at the Major & Minor version of a specific java class file.
    Our server is running in version 1.3. We are including a third party class file, I like to check before our production move, whether the file is compiled is <= Jdk1.3.
    Thanks in Advance.

    // 1) Download Jakarta BCEL
    // 2) compile this class
    import org.apache.bcel.classfile.*;
    public class Main
         public static void main(String[] args) throws Exception
              printClassVersion("c:\\foo.jar", "com/foo/Bar.class");
         public static void printClassVersion(String jarfile, String classfile) throws Exception
              ClassParser cp = new ClassParser(jarfile, classfile);
              JavaClass clazz1 = cp.parse();
              System.out.println(jarfile);
              System.out.println("Major: " + clazz1.getMajor());
              System.out.println("Minor: " + clazz1.getMinor());
    }

  • Does WLS check if the JSP .class files have been modified?

              When I precompile the JSPs from the command line with weblogic.jspc while WLS is running,
              does WLS check to see if the .class files have been updated and reload them?
              BEA Support says 5.1 SP8 does (case 198104).
              I thought I read an 'Issue' saying it did (9841?) - I can't find it now.
              It does not appear to.
              Mike
              

              It was this issue - 9341 - the description is kinda vague
              http://www.weblogic.com/docs51/classdocs/README2.html#9341
              Mike
              "[email protected]" <[email protected]> wrote:
              >
              >When I precompile the JSPs from the command line with weblogic.jspc while WLS is running,
              >does WLS check to see if the .class files have been updated and reload them?
              >
              >BEA Support says 5.1 SP8 does (case 198104).
              >
              >I thought I read an 'Issue' saying it did (9841?) - I can't find it now.
              >
              >It does not appear to.
              >
              >Mike
              

  • Where to store the servlet class files ?

    If, I store the class files for servlets under WEB-INF/classes folder,
              i get file not found exception while using WL 6.1 sp2. But, if i store
              the class file under DefaultWebApp folder, it works fine.
              Any help about where to store the class files for servlets would be
              great help.
              Thanks.
              hiren
              

    Copy Servlet in DefaultWebApp/Web-Inf/classes directory.
              Configure Servlet in web.xml deployment descriptor.
              <servlet>
              <servlet-name></servlet-name>
              <servlet-class></servlet-class>
              </servlet>
              <servlet>
              <servlet-name></servlet-name>
              <servlet-class></servlet-class>
              </servlet>
              <servlet-mapping>
              <servlet-name></servlet-name>
              <url-pattern></url-pattern>
              </servlet-mapping>
              hiren dossani wrote:
              > If, I store the class files for servlets under WEB-INF/classes folder,
              > i get file not found exception while using WL 6.1 sp2. But, if i store
              > the class file under DefaultWebApp folder, it works fine.
              > Any help about where to store the class files for servlets would be
              > great help.
              >
              > Thanks.
              >
              > --
              > hiren
              

  • Where Can I Find the JSP Class files on OC4J (Orion server)

    I am using Oracle J2EE Container (OC4J 1.0.2.2 aka Orion server) and I need to find the ".class" file generated for each JSP I created. I've looked under the "WEB-INF" directory under the "application" directory and the "persistence" directory under application-deployments and didn't find them. Any help would be appreciated. Thank you.

    hi
    Just check in _pages directory
    regds

  • Where Can I Find the JSP Class files on OC4J

    Hi,
    I am using OC4J 1.0.2.2 and I need to find the ".class" file generated for each JSP I created. I've looked under the "WEB-INF" directory under the "application" directory and the "persistence" directory under application-deployments and didn't find them. Any help would be appreciated. Thank you.

    your jsp class are compiled in a file named namejsp.jsp.jspCache in the application-deployments\your app\persistence ...
    but this file is not readable.
    To hav your jsp like .class you have to delete your directory applications-deployments\your app
    and open the file orion-web.xml and add the following:
    development="true" under the tag jsp-cahce-dirctory
    restart the server and then your jsp are created like .class

  • How to restrict the .class file from decompilation

    Hi all,
    i got a security problem. i need all the java class files to be most secured. is there any to restriction on the java class files from decompilation. is that possible?. pls help me out. it's very urgent
    thanks in advance

    You can make it harder to understand the decompiled code if you use an obfuscator. (I don't have links to any, do a google search, or search these forums, it have been discussed here previously.)
    You cannot completely prevent decompilation, though. Obfuscating does not for example not mean that any passwords you have hardcoded in the source is secure.

  • How to save library symbols' class files in packages that are not the default package?

    Hi,
    I perform the following in Flash CS5 with Flash Builder 4
    1) Create a new library symbol.
    2) Do a RightClick->Properties on the new symbol
    3) Check the options for "Export for ActionScript" and "Export in frame 1".
    4) I write a new name for my class "Class1" and click on the pencil icon "edit class definition" to edit the class.
    At this point my FlashBuilder 4 takes over and opens the "New ActionScript" dialog.
    4) I then click on Package-Browse to select a package e.g. com.mycompany.myfiles as the new class destination.
    The as file is created as com.mycompany.myfiles/Class1.as as everything seems just fine.
    5) I close the ActionScript file and back in Flash CS5 I RightClick on the symbol and select "Edit Class".
    At this time, FB4 suggests again to create the file, ignoring the fact that I already created it before.
    Do you know of a way I can make Flash CS5 remember where I created the file?
    Thanks.

    Hi,
    I didn't remove the project or delete any of the files.
    All I did was create the class file under a package that is not the default package. Then when I clicked on the Flash symbol's "Edit Class" It asked me again to create the same class file.
    Only if I create the class in the default package, it won't ask me to recreate it again.
    Bye,
      RaamEE-IL

  • Getting generated class files using the compiler api??

    I am writing a compiler/IDE for java, and i use the new JavaCompiler API
    (javax.tools.JavaCompiler)
    i want to ask, is it possible to get the generated class file(compiled file) names??
    can anyone help me with this, read at the documentation and i have no idea which one is used to do such thing..
    Or is it impossible??
    Thanks, please guide me on this..

    E.D.-inc wrote:
    I am writing a compiler/IDE for java, and i use the new JavaCompiler API
    don't.
    i want to ask, is it possible to get the generated class file(compiled file) names??
    yes, probably (after all, other tools can do it). Don't ask me how though, I've never had a need to.
    can anyone help me with this, read at the documentation and i have no idea which one is used to do such thing..
    no. Someone else reading the documentation for you won't help you any. Read it yourself, you might learn something.

Maybe you are looking for

  • The core audio for Logic 8 has stopped working.

    I was successfully running Logic 8, Protools LE and Cubase on a MacPro with Leopard (10.5.5) and a MOTU traveler interface. I loaded on the Ignition Pack bundled with Protools LE (Mbox mini), including Melodyne/Reason/Live 6. This then stopped me ope

  • How can i transfer one song off one iphone and put it on another iphone using the same itunes

    hi, me and my mum use the same itunes, my iphone and her iphone. they are both authorised. i bought a song on my phone, and my mum wants it too but itunes wont let me transfer it off my phone onto hers. what can i do

  • Autofill not working

    My autofill on 10.7.5 does not work. This happened right after I downloaded 10.7.5. What to do?

  • How to close Middleware server of CRM

    Dear All,     When I create a order in CRM, If I modify it immediately: system will give me a message: CRM_ORDER019               "Document is being distributed - changes are not possible" But our CRM system is singleton, and not connecte with R/3. S

  • Delay after song in Garage Band

    ok, so i recorded a live DJ mix set (on vinyl) onto Garage Band. it came out great, crisp, clear, yada yada yada. i break up the big long song file into each song part (there are 4 in total) and i send them to my iTunes. here's the problem.... when i