Don't know where the error is!!!

hi again
i wrote the code for the add button ,, but when i enter the path of the .au(eg a:\piano.au) in the text field and click add it will be added to my database and the .au file will be saved as a long binary data in the db,, when i come to search for it in my application i get in the voice text field something like that 61003A005C007000690061006E006F002E0061007500 not(a:\piano.au), i don't get the path so when i come to play it it will not play i don't know where the problem is ..
this is the code:
if(e.getSource()==vadd)
//User has not populated all the input fields.
if(vname.getText().equals("")|| vaddress.getText().equals("")|| vphone.getText().equals("")|| vsex.getText().equals("")|| vdob.getText().equals("")|| vtemplate.getText().equals("")|| vvoice.getText().equals(""))
JOptionPane.showMessageDialog(null, "Please fill in all the fields","Missing Fields",JOptionPane.INFORMATION_MESSAGE);
}//if
else
// save the new customer:
try
//1. take the customer's data:
int vuserId = Integer.parseInt(vid.getText());
String vuserName = vname.getText();
String vuserAddress = vaddress.getText();
String vuserPhone = vphone.getText();
String vuserSex = vsex.getText();
String vuserDateBirth = vdob.getText();
String vuserTemplate = vtemplate.getText();
String vuserVoice=vvoice.getText();
File file = new File(vuserVoice);
int fileLength = (int)file.length();
if(fileLength > 0)
fis = new FileInputStream(file);
String query = " INSERT INTO voice VALUES('"+vuserId+"', '"+vuserName+"', '"+vuserAddress+"', '"+vuserPhone+"', '"+vuserSex+"', '"+vuserDateBirth+"', '"+vuserTemplate+"', ? ) ";
PreparedStatement pstmt = conn.prepareStatement(query);
pstmt.setBinaryStream(1, fis, fileLength);
pstmt.executeUpdate();
else
String query = " INSERT INTO voice VALUES('"+vuserId+"', '"+vuserName+"', '"+vuserAddress+"', '"+vuserPhone+"', '"+vuserSex+"', '"+vuserDateBirth+"', '"+vuserTemplate+"',?) ";
stat.executeUpdate(query);
/*String query = " INSERT INTO voice VALUES('"+vuserId+"', '"+vuserName+"', '"+vuserAddress+"', '"+vuserPhone+"', '"+vuserSex+"', '"+vuserDateBirth+"', '"+vuserTemplate+"', '"+vuserVoice+"') ";
stat.executeUpdate(query);*/
vupdateTable();
} //try
catch (Exception ev)
System.out.println("Caught exception in add action: " + ev);
} //catch
}//else
}//else if
So plzz can some one help..

The characters you get is just the (reversed) unicode representation of the string you want:
class Printit{
// this shows the two representations are equal:
public static void main(String [] args){
     String tu = "" + '\u0061' + '\u003A' + '\\' /*'\u005C'*/
                       + '\u0070' + '\u0069'
                       + '\u0061' + '\u006E' + '\u006F'
                       + '\u002E'
                       + '\u0061' + '\u0075';
     System.out.println(tu);
}shows this - well the '\' is only allowed escaped, so I may not use '\005C' directly.
I suppose the field in DB has a wrong format or you do not read it the right way. The writing seems OK to me.

Similar Messages

  • Help! Class, interface, or enum expected, don't know where the error is

    hey all, I am doing a project for school but I keep getting a compiler error and I don't know why. Here is the code that keeps getting the error:
    import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
    import java.util.*;
    * Green Survivor
    * @author
    * @version
    public class Green extends Survivor
    * Constructor that simply calls Survivor's no-argument constructor.
    public Green()
    super();
    * Does whatever a Survivor does
    public void act()
    getNextMove();
    updateLife();
    * Update a Survivor's life based on its neighbors.
    public void updateLife()
    //Get a list of all neighbors that are in a square directly next
    //to us that are of type Survivor. Traverse the list. For every
    //neighbor of type Green, add one to life. For any other Survivor,
    //subtract two from life.
    ArrayList<Object> update = new ArrayList<Object>();
    update.add(getOneObjectAtOffset(1, 0, Survivor.class));
    update.add(getOneObjectAtOffset(-1, 0, Survivor.class));
    update.add(getOneObjectAtOffset(1, 1, Survivor.class));
    update.add(getOneObjectAtOffset(0, 1, Survivor.class));
    update.add(getOneObjectAtOffset(0, -1, Survivor.class));
    update.add(getOneObjectAtOffset(-1, -1, Survivor.class));
    update.add(getOneObjectAtOffset(1, -1, Survivor.class));
    update.add(getOneObjectAtOffset(-1, 1, Survivor.class));
    for(int i = 0; i < update.size(); i++)
    if(update.get(i) == Green.class)
    changeLife(1);
    else
    changeLife(-2);
    //If green is outnumbered by blue by more than 500, subtract 5 from life.
    if(green + 500 < blue)
    changeLife(-5);
    //If green is outnumbered by red by more than 500, subtract 5 from life.
    if(green + 500 < red)
    changeLife(-5);
    * Put a new object of type Green into the world at coordinates x and y.
    * Then increment green's static counter accordingly.
    public void createNew(int x, int y)
    int one = x;
    int two = y;
    new Green();
    setLocation(one, two);
    green = green + 1;
    * Green pieces should just choose an available move at random. If there
    * are no available moves, return -1.
    public int getNextMove()
    if(canMove(1) || canMove(2) || canMove(3) || canMove(0))
    int counter = (int) (Math.random() * 4);
    if(canMove(counter))
    move(counter);
    else
    counter = (int) (Math.random() * 4);
    if(canMove(counter))
    move(counter);
    else
    counter = (int) (Math.random() * 4);
    if(canMove(counter))
    move(counter);
    else
    counter = (int) (Math.random() * 4);
    if(canMove(counter))
    move(counter);
    else
    return -1;
    It is the subclass of a class that has all the methods used here (it wouldn't allow me to add that too as it said it was too many characters, I will post it if need be)
    Thanks in advance!

    [http://www.greenfoot.org/|http://www.greenfoot.org/]
    It's what we are supposed to use for class.
    I've tried to get a more complete error message because then maybe I could figure out whats wrong but that's all that comes up. and it highlights the last bracket. At first I thought it meant the brackets were off but I've triple checked that and I added an extra one in to try that out too and it changed nothing. I've even tried removing certain chunks of code to see if I could isolate the problem and the same error came up no matter what I did.
    add- using the compiler in greenfoot.
    Edited by: lysistokill on Jun 1, 2010 5:47 PM

  • How do you sync contacts with gmail, not other place on computer? I don't know where the contacts came from on that are now on my new phone. There are way too many and it is not my list of contacts I have on gmail. Where else is this from?

    I don't know where the contacts came from on that are now on my new phone. There are way too many and it is not my list of contacts I have on gmail. Where else is this from? I spent a LONG time on gmail going through my list of contacts. There were about 400 and I got it down to about 90. When I went to sync my new phone, ALL 400 synced.
    Thank you for any help!

    Sorry for the repeat...new here. OBVIOUSLY.

  • I just got a macbook pro as a gift and i wanted to upgrade to mountain lion for free but i don't know where the laptop was brought? can anyone help me?

    I just got a macbook pro as a gift and i wanted to upgrade to mountain lion for free but i don't know where the laptop was brought? can anyone help me?

    No one here would have any information as to where the MacBook Pro was purchased.
    Contact the person who gifted the Mac.
    Apple - See if you qualify for a free OS X Mountain Lion upgrade.

  • HT4796 I did all of the above and the migration was successful, but I don't know where the files are.  It says they're under a different user, 'owner' .  I tried to access via sys pref/system/users&groups, but it asks for a password for owner which I don'

    Migration Assit , PC to MAC - The migration was successful, but I don't know where the files are.  It says they're under a different user, 'owner' .  I tried to access via sys pref/system/users&groups, but it asks for a password for owner which I don't have.  What must I do to access my files?
    My experience is with MS PC's I'm new with the MAC Book Pro.

    Then, see if this works:
    Mac OS X 10.6 Help- If you forget your administrator password
    If you are running Lion or Mountain Lion you may need to do the following to access the same utility:
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    When the menubar appears select Terminal from the Utilities menu. Enter resetpassword at the prompt and press RETURN. Follow instructions in the dialog window that will appear.
    Or see Reset a Mac OS X 10.7 Lion Password and OS X Lion- Apple ID can be used to reset your user account password.

  • I have 14GB for Movie File But I have Movie File only 1GB. I don't know where the other ?

    I have 14GB for Movie File But I have Movie File only 1GB. I don't know where the other ?

    Type    .mov     into Spotlight search to see if any files show, other than the one you know about.
    Also you can try other types like    .mp4
    Al

  • I want to import a song from a shared library. Don't know where the "bottom of the itunes window" is to start the process

    I want to impoort a song from a shared library.
    Looking at the itunes help menu,
    it says at "the bottom of the itunes window" ----
    don't know where that is

    AND yea i afraid to sync my iphone and lose everything ;( i had everything perfect sync ing perfect ical,contacts,mail,apps and now sence new library I dont wana lose everything.....my hole life runs on my fone i need help bad

  • Can´t do Ichat Video, don´t know where the problems are

    I have an IMac with built in ISIght and I want tu use Ichat Video. I can chat and if I press the button beside my pic, I see a normal moving pic of the cam. If I want to open a videochat, my pic in the new opend window just stopped moving. I can the the other person moving, and we can talk, but I don´t move for the other person.
    If i look at check connection, my rame rate and Bitrate are 0.
    SO what can I do to get it working, I already tried to open the ports, written in the support article. I connect wireless to my router.

    Hi
    Have you set your Quicktime setting, goto sys prefs/quicktime/streaming/streaming speed, set to 1.5mbps(dont use automatic)
    In ichats prefs click on video and change bandwidth limit to NONE.
    Restart iChat.
    Tony

  • Lost document on my new MAC because I accidentally saved on another account that I had no permission to save to..now I don't know where the doc is but I just know its somewhere on the computer..maybe the temp files or something?!sos! please help me!!

    I saved a document, while logged in as a Guest, to another user account [it was set up for some reason to save like that (I guess the person who used computer last did that) and I didn't check before "saving"] on accident. Of course I didn't have permission to save on the other user's account but I was in a rush and so I figured everything was fine but later I found that there was a message warning me saying it did not save because it couldn't save because I had no permission to save on that account and gave me the option to duplicate or cancel.. I wasn't paying attention so I can't remember which button I hit but clearly it wasn't "duplicate"
    I took hours perfecting this document and now I can't find it.. anywhere!
    Where do these types of things go when this happens.. I know it's somewhere on the computer but where?? SOS I need the doc and I'm hoping I can find it
    I guess it's the same as someone who accidnetly hits "don't save"... question still stands.. please anyone help me!!!
    I'm trying to use Disk Drill but I only found things from November and it seems like it only shows files that have been physically/manually deleted..and my TIME MACHINE WAS NOT SET UP..because we recently got this MAC computer and had no clue what it was
    maybe its in some temp files somewhere..where do not saved documents go.. i know that it is probably writable but I know that is probably still exists
    ANYONE WITH INFO PLEASE PLEASE HELP!!

    tis true
    I know, I always do that but I was in a rush to get somewhere and I was relying on my thousand dollar Mac to do some kind of recovery or something. I know Microsoft always keeps temporary files (I think Mac does too, part of me asking here in this forum was for someone to tell me where I can find those files) and when you go to open Office Works then it gives you the option of opening the last recent documents, saved or not saved.
    I usually copy paste into my emial just in case something goes wrong with the created document but I just didn't have the time to login and do all that My loss, you live and you learn, BUT still if ANYONE got any info on this, PLEASE DO CHIME IN *keeping the hope alive*

  • After having my hard drive replaced, I tried restoring files from time machine. The restore completed but I don't know where the files were restored to. I can see they are taking up space on my hard drive but I can't get at them.

    My hard drive failed and so was replaced, luckily everything was backed up on time machine.
    I tried to do a full restore, and it went through the process but I couldn't see my files anywhere on the HD. I tried again and same thing. Eventually I used Migration Assistant and this worked fine.
    However my hard drive is now full - all my previous restores went somewhere but I can't get at them.
    Can anyone please help, I need to delete them from my system.
    Thanks

    Is the HDD in the 2009 15" MBP dead?  (The original source of your data)  If not, you might want ot take it out and put it in an enclosure.
    You might try spotlight on know files to see if that gives you any clues where your data is located.
    You might down load from the Internet OmniDiskSweeper (free) and open it.  It should show you all of the files you have on your MBP and enable to locate them.
    Ciao.

  • HT204053 I have an iCloud ID on my iPad 2 which is different to my Apple ID.  I don't know where the reset email is going to? It's not recognising my birthdate.  Could be a hacker.  What do I do?

    My iCloud Id is different to my Apple ID on my iPad 2. Trying to make them the same but cannot reset.  Reset goes to my Apple ID gmail.  This password is fine.  Gmail sees both my gmail addresses as belonging to the same person because they do.  One has a . in the name and one doesn't.  They marry up the two addresses.  This is confusing iCloud and Apple ID.  Have tried to access account through security questions but its not recognising my birthdate.  This is weird as no other matching names globally.  Maybe a hacker has taken over the iCloud account ID.  I'm not sure how to resolve.  Help please?

    Welcome to the Apple community.
    If you are unable to remember your password, security questions, don’t have access to your rescue address or are unable to reset your password for whatever reason, your only option is to contact AppleCare (or Apple ID Support), upon speaking to an operator you should explain that your problem is related to your Apple ID, this way you will not be charged for assistance, even if you don’t have an AppleCare plan.
    The operator will take you through some steps you may have already tried, however they need to be sure they have exhausted all usual approaches before trying to reset your account, so you should try to be helpful and show patience with the procedure.
    The operator will need to verify they are speaking to the account holder and may ask you some questions that only the account holder could know, and you will need to answer them if the process is to proceed.
    Once the operator has verified your identity they will send a message through to your device which contains an alpha numeric code, which you will need to read back to them.
    Once this has been completed they will send an email to your iCloud email address after a period of 24 hours, so you should check that mail is enabled in your devices iCloud settings.
    Upon receipt of the email, use the reset link provided to reset your password, after which you should be able to make the adjustments to iCloud that you wish to do.

  • I don't know where the paste button or tab is , I need to paste an address into firefox from an e-mail I have

    I am trying to paste a link from an e-mail in windows and can't find a paste/copy tab in firefox. Where is it? or how do I do it?

    Which problems do you have on that website?
    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    * Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Don't know where the work I did on my project go.

    I started working on a project weeks ago. barely did anything.  Yesterday I started working on it again, advanced half of the project, saved, open a different project, imported some XML files. when I went back to the original project it didn't open, displayed error. Restarted computer, open project again, this time it opened, only hiccup it reverted the project as to how I left it weeks ago.  Pretty much nothing. 
    All of my work is gone.  What happened.  If I saved numerous times yesterday and today, how come is all gone, it's not in autosave either.  It actually only shows 1 project in that folder and when I open it is the same as the project it reverted to.
    Please help, I don't want to start from scratch.
    Premiere Pro CC 2014
    iMac OS X Version 10.9.5

    Can you search by part of the file name?  Maybe it accidentally got moved?

  • My ipod was stolen and I need help figuring out the serial number. I don't know where the case that i bought it in is nor do I have my ipod so HELP! please!?!??!!?

    Also, I can't do that thing where you go on itunes and find out which device was last connected because I accidentallly connected a different ipod. soo yeah

    Go to the iPods syncing computer.  Open iTunes and open iTunes' Preferences.  Go to the Devices tab and hoover the mouse pointer over the backup for that iPod.  The SN whill come up.
    Als see:
    iPod: How to find the serial number

  • Uploading my new 96pg photo book - keep getting "error has occurred" - but I don't know what the error is or how to fix it.  Please advise if you know.

    I need help sending my iphoto book for printing.  When it is uploading, the bar reaches approx. 3/4 of the way, then an "error message" comes up suggesting I cancel or retry.  I've retried several times but it still won't go.  What can I do?

    set the wake-on lan on the main computer
    The laptop's too far away from the router to be connected by ethernet. It's all wifi.
    No separate server app on the laptop, it's all samba
    The files are on a windows laptop and a hard drive hooked up to the windows laptop. The windows share server is pants, so I'd need some sort of third party server running. Maybe you weren't suggesting to use Samba to connect to the windows share though?
    I'm glad that you've all understood my ramblings and taken and interest, thanks The way I see it, I can't be the only netbook user these days looking for this kind of convenience, and I certainly won't be once chrome and moblin hit the market.
    Last edited by saft (2010-03-18 20:38:08)

Maybe you are looking for