UpdateDate is not working!
Hi
I am trying to update a datetime field on MS SQL 2000 using updateDate() method in resultset. I get the error saying "invalid date format"
Here is my code
import java.sql.*;
import java.util.*;
public class testMSSQL{
public static void main(String[] args){
int ret;
Connection con=null;
Statement stmt = null;
ResultSet rs = null;
boolean exist=false;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:bdo";
con = DriverManager.getConnection(url, "", "");
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
exist = stmt.execute("select * from emp");
System.out.println("Statement has valid recordSet ? " + exist);
if(exist)
rs = stmt.getResultSet();
System.out.println("Cursor Name : " + rs.getCursorName());
int numOfColumns = rs.getMetaData().getColumnCount();
for(int k=1;k<=numOfColumns;k++)
System.out.println(rs.getMetaData().getColumnName(k) + "--" + rs.getMetaData().getColumnTypeName(k));
System.out.println("No of columns : " + numOfColumns);
Calendar cal = new GregorianCalendar();
//java.util.Date d = new java.util.Date();
//java.sql.Date d1 = new java.sql.Date(d.getTime());
//java.sql.Date d1 = java.sql.Date.valueOf("2004-08-18");
java.sql.Date d1 = new java.sql.Date(cal.getTime().getTime());
System.out.println("Date now : " + d1);
rs.moveToInsertRow();
rs.updateObject(1,"ravi");
rs.updateObject(2,new Integer(30));
rs.updateObject(3,"office");
rs.updateDate(4,new java.sql.Date(new java.util.Date().getTime()));
rs.updateObject(5,new Double(234.35));
rs.insertRow();
rs.close();
stmt.close();
con.close();
}catch(Exception ex){
System.out.println("Error:"+ex.getMessage());
}Can someone help me how to use this updateDate() method to update regular Date and DateTime fields.
thanks & regards
ravi
helloo everyone,
i have updated the date in my database and it works
just fine.
the only thing that u have to be careful is the format
of the date. try placing the date yourself, and this
is what i want to say:
Calendar cal = Calendar.getInstance();
String data =
cal.get(Calendar.DAY_OF_MONTH)+"."+(cal.get(Calendar.MO
TH)+1)+"."+cal.get(Calendar.YEAR);
and instead of point u can place "-" or "/" depending
of the format that is retrieved from the database. so
i sugest u to select the data field in your database
and see what format is it in (dd/mm/yyyy or mm/dd/yyyy
or dd-mm-yyyy or mm-dd-yyyy and so on....) and then
form tour our string that is actually the curent date.
hope that this can help uand one more thing.
try to use rs.updateString(4, "#"+data+"#");
or maybe just the rs.updateDate(4, data); will work but.... i'm using the first one and works just fine (but the sql string it is created by me and i'm not letting java to complete it (i'm using Statement))
Similar Messages
-
SELECT DISTINCT does not work - Another Problem!
Dear All
Previous Post
I just posted a thread, which has been answered by an expert. It's here:
SELECT DISTINCT does not work. Why?
My original problem was that the Query returned duplicate records, and SELECT DISTINCT did not work.
The solution was to change this select:
T0.[U_SupInv] AS 'Link'
... to this:
CAST(T0.[U_SupInv] as nvarchar(100)) AS 'Link'
The amended Query worked.
New Problem
I just discovered that resolving the problem created a new one.
The field U_SupInv (Link) is in fact a UDF.
I created it so that all Suppliers' Invoices could be Scanned to pdf files, and these pdf could be linked
to the respective AP Invoice.
Originally, when I clicked 'Link' in my Query results, the pdf scan pops up.
When the Query is amended by adding CAST, the link becomes dead.
Help
Could anyone tell me how I can make SELECT DISTINCT work, as well keeping the LINKS live?
The main purpose of my Query is to help users view the pdf scans by clicking on the links.
Thanks
Leon Lai
Here's my Original Query
SELECT
T0.[UpdateDate] AS 'Update Dt',
T0.[TaxDate] AS 'Doc Dt',
CASE T5.[TransType]
WHEN '18' THEN 'PU ' + CONVERT(VARCHAR(6), T0.[DocNum])
WHEN '19' THEN 'PC ' + CONVERT(VARCHAR(6), T0.[DocNum])
END 'SAP Ref.',
T1.[ImportLog] AS 'Ship #',
T0.[CardCode] + '' AS 'Supplier #',
T0.[CardName] AS 'Supplier Name',
T0.[DocTotal] AS 'Rs',
T1.[BlockNum] AS 'Reqn #',
T0.[DocNum] AS 'Doc No',
T0.[U_SupInv] AS 'Link'
FROM klship.[dbo].[OPCH] T0
INNER JOIN klship.[dbo].[PCH1] T1 ON T0.[DocEntry] = T1.[DocEntry]
INNER JOIN klship.[dbo].[OJDT] T5 ON T0.[TransID] = T5.[TransID]
WHERE
(T0.[UpdateDate] >= '[%2]' AND
T0.[UpdateDate] <= '[%3]' AND
T0.[U_SupInv] IS NULL)
OR
(T0.[UpdateDate] >= '[%4]' AND
T0.[UpdateDate] <= '[%5]' AND
T0.[U_SupInv] IS NOT NULL)
FOR BROWSEDear István Korös,
Thanks a lot for your answer.
I will test your suggestion tomorrow, as it's night and I am returning home now.
However, I do not think it will suit my requirements for the foll reasons:
- I worked hard to get rid of the need to enter anything in the @Scan2 field.
- This UDF was created solely as a text of instruction for my staff.
Unfortunately I had to fill in something to make the Query work.
- The problem is that if the user forgets to click the drop-down arrow and leaves @Scan2
blank, the query does not work.
- With the help of another expert, I succeeded in ignoring @Scan2 altogether.
- I posted only a simplified version of my Query on the forum, without the codes relating to eliminating the
need to enter something in @Scan2, so you may not be aware of my requirement.
- I hope you understand my reluctance. But I will try your suggestion nevertheless.
My Suggestion
I think using PCH1.VISORDER may be the solution.
If we select only those rows where visorder = 0, then
- there will be no duplication
- I need not use SELECT DISTINCT
- All my LINKS to pdf files will be live because I need not use CAST
- I may retain that part of my Query which permits ignoring @Scan2 altogether.
- A Dream!-
The problem is that I don't know how and where to place that VISORDER.
If you think I may be right, could you help me along that line?
Best Regards
Leon Lai -
I am making a web app with the flex html element. I'm trying load a couple of scripts into the index.html file to recive data, but there is one problem. I'm not getting the data.
I'm using Flash Builder 4.6 & SDK 4.6.0 to create the desktop application.
Here is the script I'm trying to run. It works when running it in the browser (google chrome, safari, firefox) but its not working in Adobe Air Desktop App. HELP!!
<script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>
</head>
<script type="text/javascript">
function updatedata() {
if(getdata == 'test'){
$.getJSON('https://api.twitch.tv/kraken/channels/bmacbook?callback=?', function beta(data) {
document.getElementById("title").innerHTML= data.status;
</script>I suspect you are running into a sanbox security issue here. See these docs/posts for details:
http://www.adobe.com/devnet/air/articles/introduction_to_air_security.html
http://www.adobe.com/devnet/air/ajax/quickstart/articles/sandbox_bridge.html
http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e3f.html
http://stackoverflow.com/questions/785823/accessing-an-iframes-contents-in-adobe-air -
Not work tablet UI on Prestigio 5080 PRO tablet
I read that browser.ui.layout.tablet = "1" can fix this problem. But it not works. I can work only in pnone interface that is not good for my 8'' tablet.
Would it be possible for you to share the problematic pdf and OS information with us at [email protected] so that we may investigate?
Thanks,
Adobe Reader Team -
Why self-defined access sequences of free goods can not work?
Hi gurus,
I have maintained access sequences of free goods self-defined.but when i creat the SO it does not work!
when i used the standard access sequences ,it is OK .
Can anybody tell me why?
thanks in advanceDear Sandy,
Go to V/N1 transaction select your self defined access sequence then go in to the accesses and fields and check all fields are activated.
Make sure that these fields are flowing in your sales order.
I hope this will help you,
Regards,
Murali. -
Adobe bridge raw not working with windows vista in photoshop cc, why?
adobe bridge raw not working in photoshop cc, is there a fix?
Your sure your using photoshop cc on windows vista?
I was under the impression that photoshop cc would not even install on windows vista.
What version of camera raw do you have?
In photoshop under Help>About Plugin does it list Camera Raw and if so which version is it?
(click on the words Camera Raw to see the version)
Camera raw doesn't work if it's a camera raw file or some other file type such as jpeg or tif?
What camera are the camera raw files from?
Officially camera raw 8.3 is the latest version of camera raw that will work on windows vista. -
Adobe Bridge CS5 in windows 7 not working?
Adobe Bridge CS5 in windows 7 not working. I was using bridge perfectly for last 2 years. It stops working since 3 days. I tried to install updates. Showing some error to install.
Tried to install creative cloud..again some error. Error code : 82
Could you please advice how I can fix my adobe bridge.https://www.youtube.com/watch?v=xDYpTOoV81Q&feature=youtu.be
please check this video I uploaded..this is what happens when I click adobe bridge.. just blinks and go off. bridge not working on task manager -
ADOBE CLOUD ON MY DESKTOP WILL NOT WORK. IT LOADS UP BUT NOTHING FILLS THE WINDOW
ADOBE CLOUD ON MY DESKTOP WILL NOT WORK. IT LOADS UP BUT NOTHING FILLS THE WINDOW
BLANK Cloud Screen http://forums.adobe.com/message/5484303 may help
-and step by step http://forums.adobe.com/thread/1440508?tstart=0
-and http://helpx.adobe.com/creative-cloud/kb/blank-white-screen-ccp.html -
Partner application logoff not working
We have a partner application registered with sso with custom login screen. The login works fine. We use the following code to logoff the partner application in logoff.jsp
response.setHeader("Osso-Return-Url", "http://my.oracle.com" );
response.sendError(470, "Oracle SSO");
session.invalidate();
but the logoff is not working properly. It is not invalidating the session and the logout http request is not going from the application server to the sso server.
Are there any additional configurations for SSO logoff.Any help is appreciated.
ThanksHi
The WF should also trigger if i add the Partner function in UI.If i change any Attribute the WF triggers but i dont want to change the attribute when i add the partner function.
If i have only one event for WF that is Partner Change the WF will not trigger it for the 1st time when i save the UI. But next i come to the same saved doc and add a partner function then the Wf triggers.
So this means that Partner change is active.
the issue here is i need to trigger the WF on , the 1st time i save the UI, for which i wil be using Attribute Change and next time when i come back to saved doc the and add only the partner function and no changes are made to attributes the WF should again trigger.
Thanks
Tarmeem -
IPhone 4 Voice Memos not working/saving
Hi there,
I'm having trouble with my voice memos too. Up until yesterday they were working fine and now, even though the record button works, the stop button does not and I can only pause them. Worse again is that the button to go into the menu to view all voice memos is not working so I can't play them from my iPhone and nothing new is saving to my iTunes. Please help!I've always had the "Include Voice Memos" option selected. I think that only pertains to syncing voice memos from iTunes to the iPhone after it has been copied to iTunes. It has to be the new OS/iTunes not communicating that new memos have been recorded. For some reason they won't sync when I want them to, and then a few syncs later they magically appear.
By the way, I'm VERY comfortable with the iTunes and iPhone systems. I've been using iTunes for 5 years, and I've been recording class lectures with the iPhone voice memo app (and another app) for a couple years. It's not an error of not seeing that the memos were added; they don't exist in my library or music folders.
JUST OUT OF CURIOSITY, POST WHICH FIRMWARE YOU ARE RUNNING EXACTLY!!!
I'm on an iPhone 4, running firmware 4.0.1 -
Installed Premiere Pro CS4 but video display does not work?
I just got my copy of CS$. After installing Premiere I found two things that seem very wrong:
1) video display does not work, not even the little playback viewer next to improted film clips located on the project / sequence window. Audio works fine.
2) the UI is way too slow for my big beefy system.
My pc is a dual boot Vista-32 and XP system with 4GB of memory installed and nvidia geforce 280 graphics board with plenty of GPU power. The CS4 is installed on the Vista-32 partition. My windows XP partition on the same PC with Premiere CS2 works great and real fast.
Any ideas how to solve this CS4 install issue?
RonI would like to thank Dan, Hunt, and Haram:
The problem is now very clear to me. The problem only shows up with video footage imported into PP CS4 encoded with "MS Video 1" codec. So this seems to be a bug. The codec is very clearly called out and supported within various menues but video with this codec just will not play in any monitor or preview window. In addition the entire product looks horrible with respect to performance while PP CS4 trys its best to play the video. Audio will start playing after about 30 seconds. And once in awhile part of video shows up at the wrong magnification before blanking out again.
My suggestion to the Adobe team: fix the bug and add some sample footage to the next release so new installations can test their systems with known footage.
My PC is brand new with the following "beefy" components:
Motherboard
nForce 790i SLI FTW
Features:
3x PCI Express x16 graphics support
PCI Express 2.0
NVIDIA SLI-Ready (requires multiple NVIDIA GeForce GPUs)
DDR3-2000 SLI-Ready memory w/ ERP 2.0 (requires select third party system memory)
Overclocking tools
NVIDIA MediaSheild w/ 9 SATA 3 Gb/sec ports
ESA Certified
NVIDIA DualNet and FirstPacket Ethernet technology
Registered
CPU: Intel Core 2 Quad Q9550
S-Spec: SLAWQ
Ver: E36105-001
Product Code: BX80569Q9550
Made in Malaysia
Pack Date: 09/04/08
Features:
Freq.: 2.83 GHz
L2 Cache: 12 MHz Cache
FSB: 1333 MHz (MT/s)
Core: 45nm
Code named: Yorkfield
Power:95W
Socket: LGA775
Cooling: Liquid Cooled
NVIDIAGeForce GTX 280 SC graphics card
Features:
1 GB of onboard memory
Full Microsoft DirectX 10
NVIDIA 2-way and 3-way SLI Ready
NVIDIA PureVideo HD technology
NVIDIA PhysX Ready
NVIDI CUDA technology
PCI Express 2.0 support
Dual-link HDCP
OpenGL 2.1 Capaple
Output: DVI (2 dual-link), HDTV
Western Digital
2 WD VelociRaptor 300 GB SATA Hard Drives configured as Raid 0
Features:
10,000 RPM, 3 Gb/sec transfer rate
RAM Memory , Corsair 4 GB (2 x 2 GB) 1333 MHz DDR3
p/n: TW3X4G1333C9DHX G
product: CM3X2048-1333C9DHX
Features:
XMS3 DHX Dual-Path 'heat xchange'
2048 x 2 MB
1333 MHz
Latency 9-9-9-24-2T
1.6V ver3.2 -
Ideapad A1-07 tablet wifi-bluet​ooth does not work!
Hello everyone. As you can see from the title on my tablet is not working wifi and bluetooth. When turning wifi tablet is reset and continues to be off and on until it forcibly turns off, and when you turn it on again, and do not touch wifi everything is normal and there are no problems with resetting. Can someone help me and give suggestion to solve this stupid problem. I'm from Croatia and I'm bad with the English writing.
Hi
Welcome To Lenovo Community
Please perform a factory reset
Please ensure you have backed any important data before doing factory reset
Hold the volume down and the power till Lenovo logo appears .
System will boot into recover mode. Follow the instructions
Hope This Helps
Cheers!!!
Important Note: If you need help, post your question in the forum, and include your system type, model number and OS. Do not post your serial number.
Did someone help you today? Press the star on the left to thank them with Kudos!
If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
Follow @LenovoForums on Twitter! -
Polygonal lasso tool not working with stylus on Surface Pro 2
Hi guys,
I'm new here so please bare with me if I'm posting in the wrong place or don't make immediate sense.
Hardeware / software used: surface pro 2 and I'm running photoshop CS5.
Problem is a fairly basic one: I am trying to make basic selections using the polygonal lasso tool (using the stylus that comes with the tablet) but it simply will not work. All I get when I touch the stylus to the screen is the circle that appears then fades. If I attach the keypad and try using that then it works no problem at all.
Does anyone have any ideas as to whether there is a particular setting that I need to switch on or off e.g. something relating to pressure sensitivity (although not sure why this would affect this particular selection tool)?
I've searched the web and come up with nothing so far so any help is greatly appreciated!
Thanks for your time
Scottsame problem on surface pro 3 !!!!
and i think quite significant, for lot of artists using polygonal lasso a lot (including me). How come that the stupid surface cannot work properly -
Excite PRO 3G connection not work after Android v4.3 update
Hello,
I live in Italy and on last Sunday (january 26th) my Excite PRO tablet (model AT10LE-A-10H) got the Android version 4.3.201121220.35.
After restart my wifi works fine, all other app work fine, but my 3g connection doesn't work, mobile network bar is empty and it says "no service".
My sim card is ok. I used this sim card before the system update and I didn't get any problem with Android 4.2.2.
Please help me.
Thank you>After restart my wifi works fine, all other app work fine, but my 3g connection doesn't work, mobile network bar is empty and it says "no service".
Go to the mobile network settings and search again for the 3G network.
I had similar problem with my Android Smartphone and my o2 provider
I started new search, then I chosen the O2 again and then I could solve the problem.
In case this does not work for you, recommend you to reset the tablet back to default (factory settings) -
A2109 tablet autorotate does not work
The autorotation on my recently purchased tablet A2109 does not work. I look in settings and the auto rotate field is not highlighted, I therefore cannot choose to turn it on.The tablet has the Android jellybean OS and I did update it but to no avail. Can anyone help?
Thanks
Solved!
Go to Solution.Dear tdsouza
Welcome in lenovo forums
just a clarification , do you mean option Rotate is dimmed in setting
Please let me know
Thanks
Alaa
Did someone help you today? Press the star on the left to thank them with a Kudo!
If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
Follow @LenovoForums on Twitter!
Maybe you are looking for
-
Issue in the standard report - S_ALR_87012357 outcome result
Dear Friends, I am facing issues in the standard report S_ALR_87012357 "Advance Return on tax Sales/Purchases" where I am trying to pull the tax posting report for the current period.Here I would like to see the tax postings which are done with the c
-
I own a iPhone and I have in ÇáÇí Cloud account, but has been disabled worked ريستور and what worked device device is linked to the account books first and I am I do not know the account and password and wrote activation iphone and I am ready to prov
-
I have read through all of the responses to this exact questions posed by other users and nothing is working. What is the most frustrating is that this is not a constant issue. One minute I will be logged onto Facebook and when I try to visit a frien
-
Why are my iCal calendars randomly disappearing with all their corresponding events?
Why are my ical calendars randonly disappearing? I updated to Maverick, but one disappeared before I did that update. I have 10 different calendars, each identified by its own color, example: "work" calendar is yellow, my personal calendar is green.
-
Greater than/less than comparisons
Hello! Does somebody has any idea why I get this error message ? Greater than/less than comparisons with character type operands may not be portable ? friendly regards erdem