Can any body Help me to prepare statement

I want to provide dynamic table name for preparestatement that i just pass table name every time and it pass me total number in that table.
I create this prepare statement
PreparedStatement prepStmt=conn_.prepareStatement("select count(*) Total from ?");
prepStmt.setString(1,"new");
but it is giving error
[JDBC SQL Server Driver] Line 1: Incorrect syntax near 'new'.
Any body can help me??
I will appreciate.

In PreparedStatement, the setString method adds quotes at the start and at the end of your String.
So your request :
select count(*) Total from ?
is interpreted :
select count(*) Total from 'new'
One possible solution is to pass your tablename parameter directly in the precompiled request :
String myTableName = "new";
PreparedStatement prepStmt=conn_.prepareStatement("select count(*) Total from "+myTableName);
In your database, you will store as many precompiled Statement as you will call this method with different parameters.
Hope it helps !

Similar Messages

  • Can any body help me to prepare f.s for!

    can any body help me to prepare f.s for!
    all material movements and asociated accoutning document?
    all open purchase orders for a given plant and delivery period?

    Hi
    what do you mean by f.s, is it functional specification?
    Material document associated accounting document you can find MSEG and BSEG tables
    Open Purchase Orders for a given plant and delivery period
    Purchase orders infirmation is available in EKKO (Header) and EKPO (Item)
    Take the information from EKKO by company code, pass it on to EKPO by plant (WERKS)which is not equal to (EKPO -ELIKZ) for open PO and for delivery date (EKET-EINDT).
    please check and let me know if you need anything.
    regards
    Srinivas

  • I am trying to find a driver to syn mini mac to Lexmark x9350. Can any body help please?

    I am trying to find a driver to syn mini mac to Lexmark x9350. Can any body help please?

    Humm... the only Lexmark X9300 download that I see is for SL 10.6...?
    Lexmark United States Support & Downloads for Lexmark X9350
    I'm not sure exactly what "component missing" means, but it sounds more like a missing driver than a missing printer part? 
    To be honest, I think your going to have to remove all previous Lexmark drivers and software from your system, temporarily connect the printer up USB and use the system updater as per the link that I posted in my first reply.
    Lexmark United States
    You might also check to see if you have a failed print job..?
    Open the Print & Fax Preferences and select Open Print Queue...
    Pause the Printer using the green button.
    Select (highlight) each of the jobs in Status and Delete them all.  
    Resume Printer using the green button and send it a new job.

  • On my macbook pro when opening a page i can not save it as a pdf only give me the option of saving it as a web page can any body help me on this I have tryed so many times without success

    on my macbook pro when opening a page on safaryi can not save it as a pdf only give me the option of saving it as a web page can any body help me on this I have tryed so many times without success?

    Just select Print in Safari and then, in the bottom left-hand corner, select PDF and you can save it to whichever flavor pdf file you like.
    Clinton

  • My Imac is ejecting every disk inserted in it, I cannot access the disks, can any body help me troubleshoot the problem. I am using snow leopard.

    My Imac is ejecting every disk inserted in it, I cannot access the disks, can any body help me troubleshoot the problem. I am using snow leopard.

    Try resetting the SMC Intel-based Macs: Resetting the System Management Controller (SMC) - Apple Support
    and PRAM How to Reset NVRAM on your Mac - Apple Support
    If those don't help you can try a cleaning disc or a quick shot of compressed air. Chances are that your drive has failed, join the club it's not all that uncommon. You can either have it replaced or purchase an inexpensive external drive. Don't buy the cute little Apple USB Superdrive, it won't work on macs with internal drives working or not.

  • My Imac is ejecting every disk inserted in it, I cannot access the disks, can any body help me troubleshoot the problem.

    My Imac is ejecting every disk inserted in it, I cannot access the disks, can any body help me troubleshoot the problem

    The frist thing to try is a drive-n disk. They are cheap (US$5-15) and easy to use. Many unresponsive drives, even ones declared "dead" by an Apple tech, have returned to service after a cleaning.
    Check with home entertainment specialty shops, electronic superstores and office supply outlets that sell computer accessories.

  • Please can any body help me out where can I find link to download  ALDSP2.5

    Hi All,
    Please can any body help me out where can I find link to download ALDSP2.5.
    I am trying since last couple of days as I am not able to find it. please some body help me out in this regard. I appriciate even if I get a link to download ALDSP3.0.
    thanks in advance.
    Please mail me the links at [email protected]
    rajen.
    Edited by: user13358281 on Jul 2, 2010 2:57 PM

    Hello Werner,
    Thanks for response, but I couldn't find the same.
    Still my search is going on. I dont know why oracle people made this that dificult, If I am not wrong I think earlier i could easily locate the previous version artifacts(softwares) easily. but now why they made that complicated.. no clues.
    any ways thanks once again.

  • TS3694 i forgot the password of my  iphone 3g and when i try to restore it it shows the message"my iphone 3g could not be restored an unknown error occurred(1015)" can any body help please..

    i forgot the password of my  iphone 3g and when i try to restore it it shows the message"my iphone 3g could not be restored an unknown error occurred(1015)" can any body help please..

    This error normally appears if you attempted to downgrade or modify your iOS. See here http://support.apple.com/kb/TS3694#error1015

  • TS1538 hi i updated my iphone 4 with itunes and now i cannot use my phone as i keep getting error 16 after trying to restore my phone....i cannot afford to replace ..can any body help me...the phone is out of warrenty so apple do not want to know....pleas

    hi i updated my iphone 4 with itunes and now i cannot use my phone as i keep getting error 16 after trying to restore my phone....i cannot afford to replace ..can any body help me...the phone is out of warrenty so apple do not want to know....please any help

    https://discussions.apple.com/message/23100453#23100453
    more hits from the search
    https://www.google.dk/search?q=restore+itphone+error+16&oq=restore+itphone+error +16&aqs=chrome..69i57j0l5.11485j0j7&sourceid=chrome&espv=210&es_sm=93&ie=UTF-8

  • HT4061 I can not connect to ITunes Store to download updates. I have no trouble connecting to the internet. It worked OK up to about a last month. can any body help.

    I can not connect to ITunes Store to download updates. I have no trouble connecting to the internet. It worked OK up to about a last month. can any body help.

    Hi there bigyellowdigger!
    I have an article here that can help you troubleshoot this issue with your connection to the iTunes Store. That article can be found right here:
    Can't connect to the iTunes Store
    http://support.apple.com/kb/ts1368
    Take care, and thanks for visiting the Apple Support Communities.
    -Braden

  • I have a brand new i phone 4s and i have updated the soft ware to the 5.1 and tried to restore it to download my old contacts and apps etc. and my computer now wont recognise my phone and itunes will not do anything can any body help please????

    I have a brand new i phone 4s and i have updated the soft ware to the 5.1 and tried to restore it to download my old contacts and apps etc. and my computer now wont recognise my phone and itunes will not do anything can any body help please???? i need this sorting asap xxxxxxx

    see if this link helps   http://support.apple.com/kb/TS1538

  • I have to install Oracle 9.2 on Solaris 9 I have no clue can any body help

    I have to install Oracle 9.2 on Solaris 9 I have no clue can any body help me I havent installed oracle on any Unix based system only done on Windows based by running the oracle installer can any one guide me how to accomplish this Task. any detailed step by step how to install from CD drive how to mount it. Please reply
    Thanks

    Hi,
    <br></br>
    <br>You can help with this doc Oracle9i Installation Guide Release 2 (9.2.0.1.0) for UNIX Systems: AIX-Based Systems, Compaq Tru64 UNIX, HP 9000 Series HP-UX, Linux Intel, and Sun Solaris</br>
    <br>Bests reagards,</br>
    <br>Nicolas</br>

  • Can any body help me in creating a jar using Weblogic server tool

    I have created the class files of the container manged bean successfully.I want to create the jar file using the weblogic tool.
    I have created a new jar file and now I have to add a bean class file and a home class file to it.In the tool I choose a the path using the choose button.When I say next it complaints that it cannot locate the bean files.
    Can any body please help me soon..
    waiting for your reply.

    I had similar problems with the WLS deploy tool. I think they were solved by making sure that I started the tool from the directory that contained the root package of my EJBs.
    It might work...

  • My macbook (born 2006, mac os x snowleopard) broke down. I started again with DVD, but can not find hard disc, to repair it - can any body help me, pleeeeease?

    first time, using that way looking for help (in former times I get it directly from apple...). My problem: my macbook was getting more and more slowly, I turned it off an after turning on again, there was only a question mark. after starting with system-DVD, I could not find the hard disc to repaire it with first aid or do any thng else. I´m writing with macbook pro of my daughter now and ugentnly need to start my macbook as soon as possible. could any body help me??? (sorry, my english is a not so well) andrea from berlin

    Since you have the system disks, you can try running the Apple Hardware Test, that should confirm if the drive is dead or not. You'll use the disk that says 'AHT Version x.x' in small print on the label.

  • Can any body help me by sending the config settings of delivery scheduling.

    hi,
    sap gurus,
    in my project there is logistics execution module.  here my concern is they are depending on district
    and regions for fixing the frieght and all, so we have to schedule the deliveries to save the damarages
    and warphage to the client.
    can any body send me how the delivery scheduling and transportation scheduling cinfigured and
    if there is any other than this.
    plz let me know and help me on this.
    regards,
    balaji.t

    Hi Balaji..
    Just see weather this is helpful to your requirement...
    Backward scheduling is the calculation of deadline dates: the arrival time at the customer site is calculated as the earliest possible goods receipt time at the customers unloading point on the requested delivery date. All four of the delivery and transportation scheduling lead times are subtracted from the customeru2019s requested delivery date to determine if this date can be met.
    The transit time, loading time, and pick/pack time are subtracted from the customeru2019s requested delivery date to calculate the required material availability date.
    The system calculates backward scheduling as follows:
    Requested delivery date minus transit time = Goods issue date
    Goods issue date minus loading time = Loading date
    Loading date minus transportation lead time = Transportation scheduling date
    Loading date minus pick/pack time = Material availability date
    By default, the system will calculate delivery dates the closest day, taking into consideration the working days of the shipping point and a rounding profile. In this case the system assumes a 24 hour work day and lead times can be entered in days up to 2 decimal points. This is referred to as daily scheduling.
    Precise scheduling calculated down to the day, hour and minute is supported. This allows the scheduling of a delivery within a single day. It is activated by maintaining the working hours for a particular shipping point.
    Backward scheduling is always carried out first. If the material availability date or transportation scheduling date is calculated to be in the past, the system must then use forward scheduling.
    Forward scheduling is also done if no product is available on the material availability date calculated by backward scheduling. The system does an availability check to determine the first possible date when product will be available. This new material availability date forms the starting point for scheduling the remaining activities. The loading time, pick/pack time, transit time, and transportation lead time are added to the new material availability date to calculate the confirmed delivery date.
    Thanks,
    Safeer Rahman

Maybe you are looking for

  • Why can't i connect to any gamecenter on my iPad?

    Why can't i connect to any gamecenter on my iPad? When i play,  i use my gamecenter to play with my friends. But it won't work! And sometimes when i play a game, my screen get out of the game. I really need help to fix this! And i use iOS 7 on a iPad

  • CS6 Design and Web Premium asking for Adobe ID sign in

    Hi We're a Univerisity and have a site licence for CS6. I created an install package for our mac's using the Enterprise Application Manager. It's been working fine for the last term, but now all of a sudden CS6 is asking for an Adobe ID to be entered

  • RFEBBECODA00: rounding calculation problem

    Hi there, I'm running program RFEBBECODA00 vi transaction FEBC but for one account in OMR (defined with 3 decimals in TCURX), SAP seems to calculate the ending balance based on amounts with 2 decimals whereas the bank statement has actually amounts w

  • Oracle TopLink Workbench - database connection

    Hello all I'm new at Toplink... I installed toplink 11.1.1.3.0 I'm trying to connect to a oracle database 10g, but I always get a message saying "The class oracle.jdbc.driver.OracleDriver was not found. Please ensure that the JDBC driver is on the Sy

  • Deploy tool Exceptions

    I am trying to deploy a WAR using the weblogic.deploy command line utility. Pretty much everything I have tried throws excpeptions. For example: // This throws MalformedURLException: no protocol .... <see stack trace below> java weblogic.deploy -debu