Help with a piece of code I don't understand

Hi,
I am a new commer to the world of Java development. In writing an app which connects to a MySQL database, I came across the following line of code:
Class.forName("com.mysql.jdbc.Driver").newInstance();
as far as I understand it, this line returns a new instance of the MySQL jdbc driver class, but it doesn't get assigned to anything. How does this work? How does the new object get referenced?
Any insight to this would be most useful,
Regards,
Jeffers3D

that's explained in the javadoc, I think :
when an object that inherits from java.sql.Driver is instantiated, it automagically registers itself with the DriverManager
then, you can write :
Connection connection = DriverManager.getConnection(url, login, password);

Similar Messages

  • Help with a Kernel Oops that I don't understand

    I'm in the process of installing Arch on a new setup based on a Zotac-IONITX-b motherboard.
    I have pretty much come to the end of the initial set up of Arch but I am experiencing something that makes me clueless, A kernel Oops.
    This is the output from dmesg as it happens:
    BUG: unable to handle kernel paging request at 000d8a0b
    IP: [<c016bfbc>] m_show+0x9c/0x1a0
    *pde = 00000000
    Oops: 0000 [#1] PREEMPT SMP
    last sysfs file: /sys/module/mbcache/initstate
    Modules linked in: ext3 jbd ipt_REJECT xt_tcpudp nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack iptable_filter ip_tables x_tables arc4 ecb snd_hda_codec_nvhdmi rt73usb crc_itu_t rt2x00usb rt2x00lib snd_hda_codec_realtek led_class snd_seq_dummy input_polldev lirc_mceusb2 lirc_dev snd_seq_oss mac80211 snd_seq_midi_event snd_hda_intel usbhid snd_seq snd_seq_device snd_hda_codec hid nvidia(P) cfg80211 snd_pcm_oss snd_mixer_oss snd_hwdep agpgart snd_pcm snd_timer ohci_hcd snd soundcore i2c_nforce2 shpchp ehci_hcd psmouse snd_page_alloc pci_hotplug pcspkr usbcore sg serio_raw i2c_core forcedeth wmi evdev thermal processor fan button battery ac rtc_cmos rtc_core rtc_lib ext2 mbcache sd_mod pata_acpi ata_generic ahci libata scsi_mod
    Pid: 1947, comm: lsmod Tainted: P (2.6.30-ARCH #1) To Be Filled By O.E.M.
    EIP: 0060:[<c016bfbc>] EFLAGS: 00010282 CPU: 0
    EIP is at m_show+0x9c/0x1a0
    EAX: 00000000 EBX: f6a615a0 ECX: 00000e76 EDX: 00000000
    ESI: f98de6e0 EDI: 000d8a0b EBP: f98de810 ESP: f69edeb4
    DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
    Process lsmod (pid: 1947, ti=f69ec000 task=f6556800 task.ti=f69ec000)
    Stack:
    f6a615a0 c0457a4c f9b76bec 00011824 f98de6e4 f69edf30 c03d28a8 88e01f5c
    c03e0768 f6a615a0 f98de6e4 f69edf30 c01ee703 c012d160 00000000 00000174
    00000000 b807c014 f6a615c8 000003ec 00000014 f65b2780 f69edf90 0000001f
    Call Trace:
    [<c03d28a8>] ? mutex_lock+0x18/0x40
    [<c01ee703>] ? seq_read+0x263/0x470
    [<c012d160>] ? __wake_up+0x50/0x80
    [<c01ee4a0>] ? seq_read+0x0/0x470
    [<c0219b59>] ? proc_reg_read+0x79/0xc0
    [<c01d1923>] ? vfs_read+0xc3/0x1a0
    [<c0219ae0>] ? proc_reg_read+0x0/0xc0
    [<c01d1b08>] ? sys_read+0x58/0xb0
    [<c0103c73>] ? sysenter_do_call+0x12/0x28
    Code: 10 31 c0 81 c5 2c 01 00 00 39 ef 74 2d 66 90 8b 47 08 89 1c 24 c7 44 24 04 4c 7a 45 c0 83 c0 0c 89 44 24 08 e8 d6 22 08 00 8b 3f <8b> 07 0f 18 00 90 39 ef 75 da b8 01 00 00 00 8b 96 d4 00 00 00
    EIP: [<c016bfbc>] m_show+0x9c/0x1a0 SS:ESP 0068:f69edeb4
    CR2: 00000000000d8a0b
    ---[ end trace a2e72733227d6c47 ]---
    My kernel skills are next to zero so I don't even know where to begin to look for things to fix. The only thing I know is that if I set the runlevel to 5 at boot I get the Oops straight at boot. It appears that xorg (with nvidia module) starts loading but only makes it to about half a deacent log file. And when I try to issue lsmod the terminal just hangs.
    Runlevel 3 boots fine witout the Oops but as soons as I try to do something module related (like lsmod again) the Oops is right there.
    Any ideas what to do about this or am I down the reinstall route again?

    I'm still having problems with this
    I don't really know where to begin when it comes to prevent modules being loaded. Which ones are safe to remove etc?
    This is what I get at boot trying to get straight into X.
    Can anyone make something out of the dump? Any ideas what might be wrong is much appreciated.
    BUG: unable to handle kernel paging request at 000d8a0b
    IP: [<c016bfbc>] m_show+0x9c/0x1a0
    *pde = 00000000
    Oops: 0000 [#1] PREEMPT SMP
    last sysfs file: /sys/devices/pci0000:00/0000:00:10.0/0000:03:00.0/resource
    Modules linked in: ext3 jbd ipt_REJECT xt_tcpudp nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack iptable_filter ip_tables x_tables arc4 ecb snd_hda_codec_nvhdmi rt73usb crc_itu_t rt2x00usb rt2x00lib led_class lirc_mceusb2 snd_seq_dummy snd_hda_codec_realtek input_polldev lirc_dev snd_seq_oss joydev mac80211 snd_seq_midi_event snd_seq usbhid snd_hda_intel snd_seq_device hid snd_hda_codec cfg80211 nvidia(P) snd_pcm_oss snd_mixer_oss snd_hwdep snd_pcm snd_timer agpgart ohci_hcd snd psmouse ehci_hcd soundcore shpchp serio_raw i2c_nforce2 pcspkr usbcore snd_page_alloc pci_hotplug sg forcedeth i2c_core wmi evdev thermal processor fan button battery ac rtc_cmos rtc_core rtc_lib ext2 mbcache sd_mod pata_acpi ata_generic ahci libata scsi_mod
    Pid: 2023, comm: X Tainted: P (2.6.30-ARCH #1) To Be Filled By O.E.M.
    EIP: 0060:[<c016bfbc>] EFLAGS: 00210282 CPU: 0
    EIP is at m_show+0x9c/0x1a0
    EAX: 00000000 EBX: f73a5540 ECX: 00000e31 EDX: 00000000
    ESI: f98ac6e0 EDI: 000d8a0b EBP: f98ac810 ESP: ec821eb4
    DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
    Process X (pid: 2023, ti=ec820000 task=ec96bc00 task.ti=ec820000)
    Stack:
    f73a5540 c0457a4c f9bfcc2c 00011824 f98ac6e4 ec821f30 c03d28a8 9f0f8b2b
    c03e0768 f73a5540 f98ac6e4 ec821f30 c01ee703 00000000 9f0f8b2b 000001b9
    00000000 b7f54014 f73a5568 000003ec 00000014 ec990900 ec821f90 00000021
    Call Trace:
    [<c03d28a8>] ? mutex_lock+0x18/0x40
    [<c01ee703>] ? seq_read+0x263/0x470
    [<c01ee4a0>] ? seq_read+0x0/0x470
    [<c0219b59>] ? proc_reg_read+0x79/0xc0
    [<c01d1923>] ? vfs_read+0xc3/0x1a0
    [<c0219ae0>] ? proc_reg_read+0x0/0xc0
    [<c01d1b08>] ? sys_read+0x58/0xb0
    [<c0103c73>] ? sysenter_do_call+0x12/0x28
    Code: 10 31 c0 81 c5 2c 01 00 00 39 ef 74 2d 66 90 8b 47 08 89 1c 24 c7 44 24 04 4c 7a 45 c0 83 c0 0c 89 44 24 08 e8 d6 22 08 00 8b 3f <8b> 07 0f 18 00 90 39 ef 75 da b8 01 00 00 00 8b 96 d4 00 00 00
    EIP: [<c016bfbc>] m_show+0x9c/0x1a0 SS:ESP 0068:ec821eb4
    CR2: 00000000000d8a0b
    ---[ end trace c0390704e02a5e60 ]---
    edit:
    I hope this is solved now. I couldn't figure out what module that was acting up so I reinstalled and started slowly to install and activate my devices. As soon as I reached the point of installing X, and specifically the nvidia drivers, it all went bonkers again.
    I uninstalled the nvidia oackage and built the beta drivers from AUR, but had the same result. I ten turned to nvidia directly and installed their driver (the.run file) and after that everything seems to run smoothly.
    So, probably there is something in the pacman package that doesn't work with my Zotac IONitx board.
    Edit again:
    The error is back and I have filed a bug report to nvidia. I'm keeping my fingers crossed that they can solve this for me.
    Last edited by antis (2009-07-28 14:55:34)

  • Help with some explanation of code

    Hi
    could some one explain how the code in italics works below.  Is the varaiable currentObject which has a data type of DragDrop an
    array as well that gets loaded up with the string values of the dragdrops array?
    public class Map extends MovieClip
            var dragdrops:Array;
            public function Map()
                // constructor code
                dragdrops = [deathvalley,goldengate,grapes,hollywood,
                 joshuatree,laketahoe,mission,redwood];
              var currentObject:DragDrop;
                for (var i:uint = 0; i < dragdrops.length; i++)
                    currentObject = dragdrops[i];
                    currentObject.target = getChildByName(currentObject.name + "_target");
    AND THIS CODE I THINK TESTS FOR IF THE OBJECT HITS ITS TARGET BUT I DON'T UNDERSTAND HOW IT WORKS?
    if (hitTestObject(target))
                    visible = false;
                    target.alpha = 1;
                    Object(parent).match();

    Hi ,
    Try to write the code in this type of format.
    I think this may help you.
    TABLES: bapiache08, bapiacgl08,bapiaccr08, bapiret2.
    DATA: t_bapiache08 LIKE TABLE OF bapiache08 WITH HEADER LINE,
    t_bapiacgl08 LIKE TABLE OF bapiacgl08 WITH HEADER LINE,
    t_bapiaccr08 LIKE TABLE OF bapiaccr08 WITH HEADER LINE,
    t_bapiret2 LIKE TABLE OF bapiret2 WITH HEADER LINE,
    ct_bapiret2 LIKE TABLE OF bapiret2 WITH HEADER LINE.
    t_bapiache08-obj_type = 'BKPFF'. "BKPFF
    t_bapiache08-obj_key = '010000000000062005'.
    t_bapiache08-obj_sys = 'T90CLNT800'. "T09CLNT800
    t_bapiache08-username = 'SSI4'.
    t_bapiache08-header_txt = 'DOCUMENT POSTING'.
    t_bapiache08-comp_code = '1000'.
    t_bapiache08-fisc_year = '2005'.
    t_bapiache08-doc_date = '20050805'.
    t_bapiache08-pstng_date = '20050805'.
    t_bapiache08-fis_period = '07'.
    t_bapiache08-doc_type = 'SA'.
    t_bapiache08-compo_acc = 'FI'. "GL
    APPEND t_bapiache08.
    t_bapiacgl08-itemno_acc = '031'.
    t_bapiacgl08-gl_account = '160000'.
    t_bapiacgl08-comp_code = '1000'.
    t_bapiacgl08-pstng_date = '20050805'.
    t_bapiacgl08-doc_type = 'SA'.
    t_bapiacgl08-fisc_year = '2005'.
    t_bapiacgl08-fis_period = '07'.
    t_bapiacgl08-stat_con = 'X'.
    t_bapiacgl08-vendor_no = '1920'. "ACCOUNTING NO.FOR VENDOR/CREDITOR.
    t_bapiacgl08-item_text = 'LINE ITEM TEXT BY VIN'.
    APPEND t_bapiacgl08.
    t_bapiaccr08-itemno_acc = '031'.
    t_bapiaccr08-currency_iso = 'EUR'.
    t_bapiaccr08-amt_doccur = '2000'.
    APPEND t_bapiaccr08.
    CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'
    EXPORTING
    documentheader = t_bapiache08
    IMPORTING
    OBJ_TYPE =
    OBJ_KEY =
    OBJ_SYS =
    TABLES
    accountgl = t_bapiacgl08
    currencyamount = t_bapiaccr08
    return = t_bapiret2
    EXTENSION1 =
    Thanks & Regards,
    Ravi Kanth Yechuri.

  • Need help with this Pascal Triangle code....

    Hey everyonr i am totally new to Java... so need your help with this code...
    the function makeRows gives me problems... main is correct ... can someone fix my makeRows... i don't see what's wrong
    public class Pascal {
      /** Return ragged array containing the first nRows rows of Pascal's
       *  triangle.
      public static int[][] makeRows(int nRows) {
            int[][] mpr  = new int[nRows+1][];
            int l=0; int r=0;
            for (int row = 0; row < nRows; row++) {
              mpr[row] = new int[row+1];  //index starts at 0
              if (row==0) {
                mpr[0][0]= 1;
                    if (row==1) {
                mpr[1][0]= 1;
                mpr[1][1]= 1;
              if (row>=2) {
                 for (int j = 0; j <= row; j++) {
                    if (j==0)               {l=0;} else {l=mpr[row-1][j-1];}
                    if (j==mpr[row].length-1) {r=0;} else{r=mpr[row-1][j];}
                    mpr[row][j] = l + r;
            return mpr;
      public static void main(String[] args) {
             if (args.length != 1) {
               System.out.println("usage: java " + Pascal.class.getName() + " N_ROWS");
               System.exit(1);
             int nRows = Integer.parseInt(args[0]);
             if (nRows > 0) {
               int[][] pascal = makeRows(nRows);
               for (int[] row : pascal) {
              for (int v : row) System.out.print(v + " ");
              System.out.println("");
         }this makeRows function should return ragged array containing the first nRows rows of Pascal's triangle
    thanks
    Edited by: magic101 on May 9, 2008 4:03 PM

    magic,
    i think corlettk meant that some people might not know what pascal's triangle is.
    also, you didnt say what was wrong with your code, just that it was wrong.
    asking smart questions is about giving as much information you can to get the
    best answer. i would throw a System.out.print between every line of your
    algorithm. i would also supply us with the values you are getting for each row.
    also, this question is asked all the time here. do a forum search.
    1
    11
    121
    1331
    14641

  • Query Help with Item Master & Warehouse Code

    Forum,
    I would like help with a query to identify any items within a database where a particular warehouse code does NOT exist against it. At present I have the following:
    select T0.ItemCode, T1.WhsCode from OITM T0
    INNER JOIN OITW T1 on T0.ItemCode = T1.ItemCode
    where T0.ItemCode NOT IN ('WHS1')
    This is returning all other instance and not just a list of item codes where 'WHS1' is missing from within the 'Stock Data' tab.
    Thanks,
    Sarah

    Hi Sarah...
    Try This
    SELECT T0.ItemCode, T0.ItemName, T1.WhsCode
    FROM OITM T0 INNER JOIN OITW T1 ON T0.ItemCode = T1.ItemCode
    WHERE T1.WhsCode not in ( 'WHS1')
    Regards
    Kennedy

  • Help with java digital signing code

    hello people.
    can anybody help me?
    i have find a java code to resolve my problem with sending pay in soap envelope with digital signature and attached certificate. i compiled it with jdk jdk1.6.0_37. and it works.
    i need it to work in built-in jvm in oracle 9i. in oracle 9i jvm release is 1.3.1. Java code does not work there. there is an error
    class import com.sun.org.apache.xerces.internal.impl.dv.util.Base64 not found in import.
    i did not find this class in network.
    can anybody help with rewriting it for jvm 1.3.1?
    thanks in advance.
    code below:
    import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
    import java.io.*;
    import java.security.Key;
    import java.security.KeyStore;
    import java.security.PrivateKey;
    import java.security.Signature;
    import java.security.cert.Certificate;
    public class Sign {
    public static void main(String[] args) throws Exception {
    // TODO code application logic here
    BufferedReader reader = new BufferedReader(new FileReader("c:\\cert.p12"));
    StringBuilder fullText = new StringBuilder();
    String line = reader.readLine();
    while (line != null) {
    fullText.append(line);
    line = reader.readLine();
    KeyStore p12 = KeyStore.getInstance("pkcs12");
    p12.load(new FileInputStream("c:\\cert.p12"), "Hfrtnf$5".toCharArray());
    //????????? ????????? ????, ??? ????? ????? ???????????? alias ? ??????
    //Key key = p12.getKey("my kkb key", "ryba-mech".toCharArray());
    Key key = (Key) p12.getKey("my kkb key", "Hfrtnf$5".toCharArray());
    Certificate userCert = (Certificate) p12.getCertificate("my kkb key");
    String base64Cert = new String(Base64.encode(userCert.getEncoded()));
    //signing
    Signature signer = Signature.getInstance("SHA1withRSA");
    signer.initSign((PrivateKey) key);
    signer.update(fullText.toString().getBytes());
    byte[] digitalSignature = signer.sign();
    String base64sign = new String(Base64.encode(digitalSignature));
    String base64Xml = new String(Base64.encode(fullText.toString().getBytes()));
    System.out.println("<certificate>" + base64Cert+"</certificate>");
    System.out.println("<xmlBody>" + base64Xml+"</xmlBody>");
    System.out.println("<signature>" + base64sign+"</signature>");
    Edited by: user13622283 on 22.01.2013 22:08

    My first search is to see if there is an Apache commons project that provides it. Lo and behold:
    http://commons.apache.org/codec/apidocs/org/apache/commons/codec/binary/Base64.html
    commons-codec.

  • Help with some java login code

    hey,
    I am a new member but used to visit the site regularly. I am undergoing a java project and I cannot seem to get my head around how to code when users log in, there name must appear at the top of each page they visit.
    User enters name into a text box. Do I use getter and setter methods? any bit of help would be of some advantage to me.
    Thanks for your time and I'll help with anyone else who is stuck.

    if JSP or servlet use Session...
    if you are using frame you have to consider... which frame is a top parent. that top frame will have the set and get method.. for you to set and retrieve the user name.. bear in mind that different object will have different user...
    so you have to play fair game ...hehehehe :-)

  • HELP WITH AN OLDER VERSION CODE!!!!!

    I am trying to figure out how to convert a code from an older version into JDK1.3.1_01.
    Please HELP!
    Here is my code............
    mport java.awt.*;
    import java.applet.*;
    public class Race extends Applet {
    private Button myButton; //use a button to start the race.
    int race_square; //record the race square 70.
    int t_square; //record the tortoise's position.
    int h_square; //record the hare's position.
    int clock; //record clock ticks.
    public void init()
    myButton=new Button("Start Clock") ; //add button to the top of panel.
    add("North",myButton);
    reset_v();
    public void reset_v()
    race_square=70; // total squares is 70
    t_square=1; //start point =1
    h_square=1; //start point=1
    clock=0; //reset the clock to zero.
    public void race() {
    int i=0; //set some integer varibles.
    int t_random=0; //random number for tortoise.
    int h_random=0; //random number for hare.
    Graphics g=getGraphics(); //define graphics.
    Rectangle r = bounds(); //define painting boundary.
    g.drawString("BANG !!!!!",100,r.height/2-80);
    g.drawString("AND THEY'RE OFF !!!!!",100,r.height/2-70);
    g.drawString(Integer.toString(clock),r.width/2,50); //show the zero clock time.
    do{
    try { Thread.sleep(1000);} //clock ticks 1 second.
    catch (InterruptedException e){}
    clock++;
    g.setColor(Color.lightGray); //clear all the old drawings
    g.fillRect(0,0,r.width,r.height);
    g.setColor(Color.black);
    g.drawString(Integer.toString(clock),r.width/2,50); //show the clock time.
    t_random=getrandom(); // FOR TORTOISE
    if (t_random<=5) t_square+=3; // 50% fast plod: 3 squares to the right.
    else if (t_random>5 && t_random<=7)t_square-=6; // 20% slip: 6 squares to the left.
    else t_square+=1; // 30% slow plod: 1 square to the right.
    h_random=getrandom(); //FOR HARE
    if (h_random<=2) {} // 20% sleep: not move at all.
    else if (h_random>2 && h_random<=4)h_square+=9;// 20% big hop: 9 squares to the right.
    else if (h_random==5) h_square-=12; // 10% big slip: 12 squares to the left.
    else if (h_random>5 && h_random<=8)h_square+=1;// 30% slow hop: 1 square to the right.
    else h_square-=2; // 20% small slip: 2 aquares to the left.
    if(t_square<=0) t_square=1; //always start from 1.
    if(t_square>race_square)t_square=race_square;
    if(h_square<=0) h_square=1; //always start from 1.
    if(h_square>race_square)h_square=race_square;
    g.setColor(Color.red); //draw the tortoise's path: use red color.
    g.fillRect(5,r.height/2-5,5*t_square,5);
    g.drawString("T",5*t_square,r.height/2-7);
    g.setColor(Color.blue); //draw the hare path: use blue color.
    g.fillRect(5,r.height/2+1,5*h_square,5);
    g.drawString("H",5*h_square,r.height/2+17);
    g.setColor(Color.black); //draw the race squares.
    g.drawLine(5,r.height/2,5+5*race_square,r.height/2);
    for(i=5;i<=5+5*race_square;i+=5)
    g.drawLine(i,r.height/2-5,i,r.height/2+5);
    if (t_square==h_square &&t_square!=race_square) // tortoise bites the hare.
    g.drawString("OUCH!!!",5+5*h_square,r.height/2-16);
    }while ( t_square=race_square && h_square=race_square && t_square<=5+5*race_square;i+=5)
    g.drawLine(i,r.height/2-5,i,r.height/2+5);
    g.drawString("T",5,r.height/2-7); //mark tortoise
    g.drawString("H",5,r.height/2+17); //mark hare
    public int getrandom()
    return( 1+(int)(Math.random()*10)); // generating the random number 1 to 10.
    public boolean action(Event e, Object arg)
    if (e.target instanceof Button)
    reset_v(); //reset the initial variables.
    race(); //use the button the start the race.
    return true;

    You posted this yesterday, at
    http://forum.java.sun.com/thread.jsp?forum=54&thread=185330
    The code you've posted doesn't seem to include Ilikejava's suggested changes - which are, as far as I can tell, the major changes required to bring your applet in line with Java 1.3.
    It will be easier to help if you show what is wrong with your code, if it's generating a compiler error message or throwing an exception.
    Regards,
    -Troy

  • Elasticity: help with converting Flash 5 code to Flash 8

    Hello
    because I have to make a flash menu with elasticity effect I
    came upon this tutorial:
    http://www.kirupa.com/developer/actionscript/spring.htm
    All OK but the code there works only with Flash 5. I somehow
    managed to concoct code that works for Flash 6 but still I didn't
    come even close to a code working in Flash 8. I'm using
    Actionscript only from version 7, I do not know anything about
    Flash 5 and 6. So please, the more experienced guys, help me!!
    The code I concocted is:
    MovieClip.prototype.move = function (centerx, centery,
    inertia, k) {
    this.x = -this._x+centerx;
    this.y = -this._y+centery;
    this.xp = this.xp*inertia+this.x*k;
    this.yp = this.yp*inertia+this.y*k;
    this._x += this.xp;
    this._y += this.yp;
    onEnterFrame=function() {
    this.move (_root._xmouse,_root._ymouse,0.9,0.1) ;
    This whole code is on the timeline of the MC being moved.
    So now the only thing I need is to make this code work for
    Flash 8
    Please, help

    Just managed to do it !

  • Could someone help with some pathfinding game code using Director please?

    Hey guys, i`m new to director and am trying to create a very basic graffiti game with pathfinding code. any links to online tutorials or code sites would be much appreciated! thanks in advance!

    I don't understand how pathfinding relates to graffiti, but here is a Lingo implementation of the A* algorithm

  • Some code I don't understand

    Ok I know that the code below is a sql statement that is created as a string in a java program. What I don't understand is what the bolded portion is doing. I know that the + stands for concat in most case but I don't understand its purpose below. These items are declared as private strings what does that have to do with it?
    String sql = "select stddev_samp(enteredvalue) as stddev from (" +
    " select enteredvalue, " +
    " row_number() over (order by m1.u_calc_no desc) AS rowcount " +
    " from sdidataitem sd, s_sample s1, s_sample s2, u_melt m1, u_melt m2 "+
    " where s1.s_sampleid=sd.keyid1 " +
    " and sd.sdcid='Sample' " +
    " and s1.sampletypeid='" + sampletype + "' " +
    " and s1.samplestatus in ('Approved','Reported','Completed') " +
    " and sd.paramid='" + strIParamid + "' " +
    " and sd.paramtype='" + paramtype + "' " +
    " and sd.enteredvalue is not null " +
    " and s1.s_sampleid <> s2.s_sampleid " +
    " and s2.s_sampleid = '" + sampleid + "' " +
    " and s1.u_meltid = m1.u_meltid " +
    " and s2.u_meltid = m2.u_meltid " +
    " and m1.u_alloy_codeid = m2.u_alloy_codeid " +
    " and m1.u_calc_no < m2.u_calc_no " +
    " ) where rowcount<=50";+
    Message was edited by:
    Egyptgirl18

    If you were to rewrite the sql with proper indentation as shown below,
    what the sql statement is doing will be clearer for you.
    String sql =
    "select "+
    "stddev_samp(enteredvalue) as stddev "+
    "from ( " +
    "select "+
    "enteredvalue, " +
    "row_number() over (order by m1.u_calc_no desc) AS
    rowcount " +
    "from "+
    "sdidataitem sd, "+
    "s_sample s1, "+
    "s_sample s2, "+
    "u_melt m1, "+
    "u_melt m2 "+
    "where "+
    "s1.s_sampleid=sd.keyid1 and " +
    "sd.sdcid='Sample' and " +
    "s1.sampletypeid=" +"'" + sampletype +"'"+ " and " +
    "s1.samplestatus in ('Approved','Reported','Completed') and " +
    "sd.paramid='" + strIParamid + "' and " +
    "sd.paramtype='" + paramtype + "' and " +
    "sd.enteredvalue is not null and" +
    "s1.s_sampleid <> s2.s_sampleid and " +
    "s2.s_sampleid =" + "'" + sampleid + "'" + " and " +
    "s1.u_meltid = m1.u_meltid and " +
    "s2.u_meltid = m2.u_meltid and " +
    "m1.u_alloy_codeid = m2.u_alloy_codeid and " +
    "m1.u_calc_no < m2.u_calc_no " +
    ") "+
    "where "+
    "rowcount<=50 ";

  • Problem with simple piece of code - please help

    For some reason the following code will not compile - im being told i need a return - however i cant see where or why?
    Please help
    Thanks
    * Author: hc01pl
    * Created: 16 April 2002 14:45:48
    * Modified: 16 April 2002 14:45:48
    //package csci1003testprograms.Gui;
    public class Task2
         // students id number
         private int id;
         // students name
         private String name;
         // students mark 1
         private int mark1;
         // students mark 2
         private int mark2;
         // constucts a student with given id, name and two module marks
         public void StudentMarks(int aID, String aName, int aMark1, int aMark2)
              id = aID;
              name = aName;
              mark1 = aMark1;
              mark2 = aMark2;
         // returns student id
         public int getID()
              return id;
         //returns student name
         public String getName()
              return name;
         //returns student's first mark
         public int getMark1()
              return mark1;
         //returns student's first mark
         public int getMark2()
              return mark2;
         //sets the first mark of a student
         public void setMark1(int aMark1)
              mark1 = aMark1;
         //sets the second mark of a student
         public void setMark2(int aMark2)
              mark2 = aMark2;
         //returns the grade of a student
         public String getGrade()
              int mark = mark1 + mark2;
              if (mark<30)
                   System.out.println("F");
              else
                   if (mark>=30&& mark<40)
                        System.out.println("U");
                   else
                        if (mark>=40&& mark<50)
                             System.out.println("D");
                        else
                             if (mark>=50&& mark<60)
                                  System.out.println("C");
                             else
                                  if (mark>=60&& mark<70)
                                       System.out.println("B");
                                  else
                                       if (mark>=70&& mark<80)
                                            System.out.println("A");
                                       else
                                            if (mark>=80)
                                                 System.out.println("A*");

    The answer is given by asantoas. You need a return statement. Because your method
    public String getGrade(), has a return type String , so the method expects to return a String datatype.
    If you don't want to return any thing. Then declare the method as public void getGrade()
    Regards
    Deepa Datar

  • Need Help with Cue Points/Custome Code

    So I've figured out that videos with a playback component need cue points in order to set up all the interactivity I want to use. The only way to make animated graphics, interactive graphs and text is to apparently create custom code, which I no zip about.
    Should I hire someone to do that for me? I was thinking elance, but does anyone have any suggestions on how to make an interactive video other ways (or cheaper)ways.
    p.s
    how much do you think I should charge for that:)?

    My advice... start with a very simple "proof of concept" project before you attempt the entire package.
    It will be much easier to scale up if you first have a very good understanding of what's going on.
    So one simple video with just one cuepoint and only one button and additional display. You'll also have to work out the interaction of pausing the video when a cuepoint is reached or button pushed to display the graph, giving the viewer time to read the graph... then when the viewer closes the graph, the video should "resume".
    Start very simple and build on that only after you understand the fundamentals.
    Second, you mention "video reports"... plural. So that most likely means that you will need a video player with a "playlist".
    This may mean that you'll need to learn to use a little .xml to bring in the playlist data. You may also find xml an excellant way to bring other data into you project.
    At the link listed above there is an excellant tutorial on "Integrating Flash and XML"
    "Flash and XML"
    "XML Video Playlist"
    "ActionScript 3 XML Basics"
    "ActionScript 3 Advanced XML"
    Personally I would not even begin a project like this without considering how I could use xml to feed data into the project.
    Here's an example of a video player I created that has a playlist, thumbnails, categories, transcipts, "Now Playing" etc. All that data comes into the main .swf via various xml files. Super good way in input data into Flash.
    http://www.drheimer.com/video/
    Yours is a rather ambitious project and will take awhile to gain the skill and assemble the pieces. So when you come to a new part... first create a real simple "proof of concept" model so you can learn how that section works. Don't expect to be able to assemble the entire project all at once.
    Best wishes,
    Adninjastrator

  • Can anyone help with my mail chimp code?

    Hi there,
    Ive just embedded a mail chimp sign up form into the footer of my website. In dreamweaver i changed the font and positioning with css to style it how i wanted.
    It shows up fine in the dreamweaver design window but not upon upload. What have i done wrong?!
    Heres the link - http://www.allroots.org/contact/index.html
    Cheers
    Benn

    Well the creating a css rule without the specific code given on the mail chimp website didnt seem possible. I was only able to edit the text and not the data entry field or submit button. Following the instructions on teh mail chimp website did get me so far but ive hot a brick wall now!
    Heres my source code -
    <!-- Begin MailChimp Signup Form -->
    <link href="http://cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
    <style type="text/css">
              #mc_embed_signup{background:#7B6E61; clear:left; font:14px Helvetica,Arial,sans-serif;  width:250px; height: 150px;}
              /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
                 We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
    </style>
    <div id="mc_embed_signup">
    <form action="http://allroots.us6.list-manage.com/subscribe/post?u=593e891a11547e228091cba9f&id=3e371df9 46" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
              <label for="mce-EMAIL">Subscribe to our mailing list</label>
              <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
              <div class="clear"><input type="submit" value="go" name="Subscribe" id="mc-embedded-subscribe" class="button"></div>
    </form>
    </div>
    <!--End mc_embed_signup-->
    And heres my CSS -
    #mc_embed_signup {
              margin-right: 45px;
              margin-left: 65px;
    div.mc-field-group label {
    div.mc-field-group input {
    div.mc-field-group select {
    #mc-embedded-subscribe-form {
              font-family: "Londrina Shadow";
              font-size: 24px;
              text-align: center;
    div.mc-field-group {
    div.mc-field-group input {
    input.button {
    #footerfacebook style {
              font-family: Positiv-A;

  • Need help with crazy custom calculations code in Acrobat XI pro

    Im trying to calculate some text feilds together and just cant figure it out.  I have two text feild boxes that I would input certain numbers to calculate in, Textfeild D5 and D6,  once the user supplies the numbers in the D5 and D6   I need a text feild (D9) to calculate and produce a number thats used in another calculation. Any help would be greatly appriciated. Im good at HTML and CSS but only begining with javascript. Im using acrobat XI pro and I put this code in the custom javascript area within the text feld "D9" properties.
    var Dsix = +getField("D6").value;
    var Dfive = +getFeild("D5").value;
    var B2 = 0.37;
    var B3 = 0.45;
    var B4 = 0.53;
    if (Dsix = 15){
    D9.value = B2*Dfive;
    if (Dsix = 30){
    D9.value = B3*Dfive;
    if (Dsix = 45){
    D9.value = B4*Dfive;

    Well thats makes since but unfortunitly it didnt work. The green text feild D9 is where im placing code at. they will be hiiden feilds. the red outlined text feilds are all input feilds. seconds is D6 and nozzels is D5.

Maybe you are looking for

  • Photo Stream not working correctly

    Ok so here is my situation: iPhone4s - Photo Stream folder shows iPhone photos and iPad photos. Perfect. IPad2 - Photo Stream folder shows iPhone photos and iPad photos. Perfect. PC - Photo Stream folder shows iPhone photos but does NOT show iPad pho

  • Problem with optical drive

    Hello I backed up all my files onto a DVD. Then formatted and reinstalled Windows 7 Ultimate. At first I could access the files on my DVD, now It says I must format the disk in drive D before I can use it. When I cancel, it says D:\ is not accessable

  • How to disable java vm

    there is a website need to run applet, but must disble sun java vm. when i disble java, i was told "enable java first". when i enable java i was told "disable sun java vm first". what should do. i am using windows xp and jre1.4.1

  • Changing preferences

    How do I change my mail preferences, so in replies, I don't quote the original message? Is this possible?

  • Project library not showing up in event library. Why?

    I am trying to create a trailer and the movie I have just made is not appearing in the event library... what am I forgetting to do? I am New to this version of imovie, I am happy with the new stuff - just not up to speed Thanks for any help!