15,913,709 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Sushil 07101990 (Top 5 by date)
Sushil 07101990
13-Nov-13 12:11pm
View
No its already updated.
Kindly provide some other solution
Sushil 07101990
11-Nov-13 11:51am
View
Dear Nagy,
As per your above code, I implemented the same in my code which looks likes below:-
private boolean enterDataIntoMSAccessDatabaseusingPreparedStatement()
{
try {
ps = connection.prepareStatement("INSERT INTO Cart ID Details VALUES (?,?,?,?,?,?,?)");
System.out.println("After Query");
}
catch (SQLException se) {
generateErrorMessage("Error in Prepared Statement \n " + se.getMessage() );
return false;
}
catch (Exception e)
{
generateErrorMessage("Unexpected Error Occured \n " + e.getMessage());
}
String todaysDate = cartIDApplicationAddCartIDDatejTextField.getText().trim();
String cartID = cartIDApplicationAddCartIDCartIDjTextField.getText().trim();
String clientName = cartIDApplicationAddCartIDClientNamejTextField.getText().trim();
String teamSegment = cartIDApplicationAddCartIDTeamAndSegmentjTextField.getText().trim();
String duration = cartIDApplicationAddCartIDDurationjTextField.getText().trim();
String tapeID = cartIDApplicationAddCartIDTapeIDjTextField.getText().trim();
String startDate = cartIDApplicationAddCartIDStartDatejTextField.getText().trim();
String endDate = cartIDApplicationAddCartIDEndDatejTextField.getText().trim();
try {
System.out.println("Before ps.setString()");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-mm-dd", Locale.ENGLISH);
System.out.println("Simple Date Format");
/*ps.setString(1, todaysDate);
ps.setString(2, cartID );
ps.setString(3, clientName);
ps.setString(4, teamSegment);
ps.setString(5, duration);
ps.setString(6, tapeID);
ps.setString(7, startDate);
ps.setString(8, endDate);*/
ps.setDate(1, new java.sql.Date(simpleDateFormat.parse(todaysDate).getTime()));
ps.setString(2, cartID);
ps.setString(3, clientName);
ps.setString(4, teamSegment);
ps.setString(5, duration);
ps.setString(6, tapeID);
ps.setDate(7, new java.sql.Date(simpleDateFormat.parse(startDate).getTime()));
ps.setDate(8, new java.sql.Date(simpleDateFormat.parse(endDate).getTime()));
System.out.println("After ps.setString()");
ps.executeUpdate();
}
catch (SQLException se) {
generateErrorMessage("Error while inserting data in database \n " + se.getMessage());
return false;
}
catch (Exception e)
{
generateErrorMessage("Unexpected Error Occured \n" + e.getMessage() );
}
return true;
}
I got below error after implementing the above code:-
Unexpected Error Occured
Unparseable date: "11-Nov-2013"
Kindly help me for the same.
Sushil 07101990
3-Oct-13 12:52pm
View
I don't know how to implement the same. Can you explain the same shortly ?
Sushil 07101990
3-Oct-13 5:39am
View
After Commenting Class.forName(driverName).newInstance() I am getting following Runtime Exception:-
jdbc:sqlserver://192.168.69.189:1433;instance=MSRS11.MSSQLSERVER;DatabaseName=Ra
diocity_Central;integratedSecurity=true
java.sql.SQLException: No suitable driver found for jdbc:sqlserver://192.168.69.
189:1433;instance=MSRS11.MSSQLSERVER;DatabaseName=Radiocity_Central;integratedSe
curity=true
at java.sql.DriverManager.getConnection(DriverManager.java:602)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at ConnectDatabase.getConnection(ConnectDatabase.java:23)
at ConnectDatabase.main(ConnectDatabase.java:51)
What to do now ?
Sushil 07101990
2-Oct-13 7:22am
View
How to add it & what is the use of same?