Can I update OS X 10.6.3 to 10.6.8 after installation?
I recently purchased Mac OS X 10.6 and got version 10.6.3.I expected to get version 10.6.8. Can I update to 10.6.8 after installation?
Hello,
I am trying to install 10.6.8 on a computer which is not connected to the internet.
How do I get from 10.6, which I had to purchase on a disc due to the fricking new IOS on my phone, to 10.6.8.
I downloaded what I thought was 10.6.8 update, and it said "you need to have 10.6.7". This is infuriating.
I'd like to get my music back onto my Iphone soon.
Thanks
Similar Messages
-
Can i update ios 6.1.3 in my i phone 4s after updating ios 7.0 ?
can i update ios 6.1.3 in my i phone 4s after updating ios 7.0 ?
THANKSS
But i don't like this iOS (iOS 7.0) ,it's too slow !!!!!!!
i need my own iPhone with iOS 6.1.3
can u give me any solution for this trouble,, plzz help me !!! -
Quick question.
What is the total space Update Rollup 7 For Exchange 2010 SP3 (KB2961522) will take after installation?
HasanHi
Your question is a big vague. Extracting the rollup will use some space but you can delete the files afterwards.
Are you concerned about space while installing? If you have adequate space it shouldnt be a problem.
Hope this helps. Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
I am asking space after installation, it will definitely install some files so how much space extra space it needed in exchange directory drive.
Hasan -
The latest Firefox update, installed this morning 6/21/2011, disabled McAfee. After installation, a window appeared stating that McAfee was not compatible and couldn't be enabled. This is NOT ACCEPTABLE! Please let me know how to uninstall this update.
Upgrade your browser to Firefox 8 and check
* getfirefox.com -
How can i update to x lion for free (i bought my iMac after 6/6)
Hey there....
I bought my new iMac after 6/6/2011 from isuare in Greece and apple sent me an e-mail to upgrade my software for free.... How can i do this......
Please help me.....Free Lion? check here
http://www.apple.com/macosx/uptodate/ -
Since last two weeks I am unable to update my applications installed in iPad with iOS 6. Also no new app is getting installed. Installation icon appears but after some time error message "unable to connect iTunes " appears.Can some one guide me to solve this problem please?
I've had similar problems. Whenever I try and update apps on the iPhone, the app would apparently download ok, but then not install. This didn't happen with new apps - only ones I was updating.
I got around the issue by downloading the update in iTunes on my Mac, then deleting the app from the phone, then syncing. The problem with this method is that certain apps had saved settings which are lost when following this method.
However... I seem to have fixed the issue after 2 months of trying.
I followed the advice of this page:
http://www.iphoneatlas.com/2008/09/10/itunes-8-workaround-for-5002-unknown-error -when-trying-to-update-apps/
Then I repaired disk permissions and finally I completely erased and restored my iPhone BEFORE I synced it after the moving of the Mobile Applications folder.
It's all working perfectly now and made my life much easier (especially with Aurora Feint updates), so I hope that this method works for some others.
Good luck.
Dom -
Trying to update frpm itunes 10 to itunes11, but get error message after installation
I am trying to update my itunes to be compatible with my replaced iphone 4s (apllecare replacement) that is not compatible with my current iTunes 10.6. I have tried several times to upload th enew version of iTunes to no avial getting an error message after a "successful installation" and the itunes reverts to 10.6. Since my imac was an older unit I had to update to OSX 10.6.8 (sucessfully) and increase my RAM. I am 120bucks in the hole plus the 49 dolar surcharge for the iphone replacement and i am still no closer to restoring my phone. Help please
First backup your music and content.
Then delete iTunes 10.6 Drag the application from Finder > Applications to Trash. Empty Trash
Try and install 10.7 first iPhone 4s will work with this. You can find the download here
http://support.apple.com/kb/DL1576
Install it. Does itunes 10.7 now appear? Is your content all there? Connect up your iPhone and start syncing.
From there if you want to you can upgrade to iTunes 11 but it is only necassary if you have an iPhone 5 -
Can't update Safari to 3.1.1 or 3.1.2
I have been unsuccessfully trying to update Safari to 3.1.1. I get as far as downloading when I get a message that says that I need 10.5.2 or newer to run this update. I have 10.5.4! I currently have safari 3.0.4 and would like the new version in order to use the mobileme features. Any ideas on what is causing this or what I can do to fix it? Thanks!
You can't update from the download; you must use your Mac OS X installer disc. Insert the disc and browse to the folder named Optional Installs; inside is a package with the same or similar name. Open it and you can choose which application(s) to install there. When that's done, repair permissions, then use Software Update to bring your system up to date. Always have a backup before you install anything.
This issue has been covered numerous times, so you should search the forums for your problem before posting; you could have saved yourself a lot of time.
Mulder -
Can't update my Mac App Store applications
I bought my Mac when my Apple account was set to USA and installed some apps like XCode, Adobe Revel, Twitter, Amazon Kindle, Touchgrind, iPhoto, etc. Later I changed my account's country to where I live now and where my credit card is from now to buy Pages. Now I can't update my applications and my purchased list is empty, even after uninstalling the applications and installing them again.
Imagine that I won't be able to update Xcode again, huge problem for iOS development. I'm think I'll do a complete reinstall using OS X Lion recovery but I'm afraid that I will have to buy iPhoto, iMovie, GarageBand and FaceTime even if they are free with every new Mac.
Is there any solution? Will I lose my free iLife apps doing a reinstall?
I already contacted Apple support and they are very good in apologizing.
Thanks!The issue is that your credit or debit card credentials must be associated with the same country where you reside.
"Although you can browse the iTunes Store in any country without being signed in, you can only purchase content from the iTunes Store for your own country. This is enforced via the billing address associated with your credit card or other payment method that you use with the iTunes Store, rather than your actual geographic location."
From here > The Complete Guide to Using the iTunes Store | iLounge Article
Sorry, but you won't be able to update any apps purchased using a different credit or debit card account from another country.
Is there any solution? Will I lose my free iLife apps doing a reinstall?
They will probably reinsstall but you won't be able to download updates since they were purchased from another country. -
Can I update with a CAB file after I installed BizTalk ?
Can I update my base configuration of BizTalk with a cab file after everthing is installed and configured ?
I missed installing it while I was installing BizTalk for the first time, now I want to update it with a CAB file. Is that possible ?Hi,
BizTalk Server relies on different products and technologies to provide essential services and features. CAB file contains softwares that are required by BizTalk server to
successfully install on your computer.
You can select the cab file based on the edition and server you working with. Link below:
Redistributable CAB Files
Now coming to your question, as I have mentioned above the CAB file contains the
prerequisites
required for successful installation of BizTalk. While installing BizTalk on Redistributable
prerequisites
screen you must have either manually or automatically installed the CAB file already.
If you have already successfully installed and configured BizTalk, I dont see any issue with the CAB file.
I don't buy that 90% consumption of the CPU is due to bad or wrong CAB file selected while installing BizTalk.
I would advise you to go through the below link:
What you need to do to prepare for and install BizTalk Server
Rachit -
How can I update my app store account ?
Hi, I have a new Iphone and I wanted to add some applications from apple store.
Unfortunately, I had a message saying that I was using app store on a new device (true) and they needed to check some security thing from my visa card. Unfortunately, I had a new card and do not have the previous one anylonger (the previous one expires in 1 year but had to be cancelled).
Therefore I am blocked and cannot get into my account.
How can I update my bank account and get into the apple store again ?
Thanks
NadiegeGreat, it worked. i could update the account from the laptop (but not from the phone).
Many thanks for such a swift feedback !! -
I recently upgraded from 3Gs to Iphone4 and want to use my old 3Gs as an ipod. how can i update
the user ID on the 3gs to a new one that I have as it is still showing a previous user ID?Settings>Store...tap the ID shown...sign out...sign back in with the ID you want to use.
-
How can i update data in JTable at run time ?
i am trying to build a client/server architecture for conducting quizzes & online tests.. My client will return a object to the server after the test is over, which contains details about the participant, his score and other details. i am putting the incoming object to an Vector. I'll create a new thread each time for the incoming connection and insert the object to the Vector.. Now, please tell me tat, how can i update my table automatically at run time so tat, my table is updated whenever a new object is entered into vector..
here is my code for the table..
public class MyTableModel extends AbstractTableModel {
String columNames[] = { "ID", "NAME", "COLLEGE", "SCORE", "CELL" };
/** Creates a new instance of MyTableModel */
public MyTableModel() {
Main.List = new Vector();
SetDefaultData();
public int getRowCount() {
return Main.List == null ? 0 : Main.List.size();
public int getColumnCount() {
return columNames.length;
public String getColumnName(int column) {
return columNames[column];
public boolean isCellEditable(int row,int col) {
return false;
public Object getValueAt(int rowindex, int columnindex) {
if(rowindex < 0 || rowindex >= getRowCount())
return "";
Student row = (Student)Main.List.elementAt(rowindex);
switch (columnindex)
case 0 : return row.id;
case 1 : return row.name;
case 2 : return row.college;
case 3 : return row.score;
case 4 : return row.cell;
return "";
public String getTitle() {
return "Student Table";
private void SetDefaultData() {
Main.List.removeAllElements();
Main.List.addElement(new Student("CS041","Keerthivasan M","MNM",95,"9884326321"));
Main.List.addElement(new Student("CS012","Arun M","MNM",90,"9884825780"));
Main.List.addElement(new Student("CS019","Balaji S","MNM",79,"9841742068"));
Main.List.addElement(new Student("CS005","Anand R","MNM",89,"9884130727"));
Main.List.addElement(new Student("CS045","Manish J","MNM",55,"9841624625"));
Main.List.addElement(new Student("CS013","Mangal S","MNM",5,"9841961742"));
}In the future Swing related questions should be posted in the Swing forum.
how can i update my table automatically at run time so tat, my table is
updated whenever a new object is entered into vector..You don't update the Vector directly. You should be creating a method in your TableModel, called "addRow(...)". This method will do two things:
a) add the Student object to the Vector
b) invoke the fireTableRowsInserted(..) method of AbstractTableModel. This will cause the table to be repainted. -
When I tried to update my iPad I got an error 9. Now, I am unable to access my iPad. It is in a continuous cycle when I try to update or restore the iPad 2. Plug in to iTunes 12.0.1 (latest version). Click update, told can't update, have to restore. Restore fails with error 9. Any help appreciated.
Here's the cycle:
I plug in my iPad when “cable to iTunes shows on iPad screen. It says "Your iPad can't be updated, you must restore it to factory settings." That bad enough news, but it gets worse.
Click Restore
Extracting software…
Preparing iPad for restore
Waiting for iPad…
Verifying iPad restore with Apple…
(empty bar under the Apple logo…does not show any activity)
“The iPad “iPad” could not be restored. An unknown error occurred (9).”
Notes: I just upgraded to OS X Yosemite 10.10.1 on my iMac (27-inch, Mid 2011) in the last week. It’s the first time I’m tried to backup/update my iPad since the iMac update.
I swapped out the USB cable to a new cable and get the same results.
I also unplugged all other USB devices from the iMac and security on my iPad and still get the same results.
I find it strange that it shows no Serial number for my my iPad 2 when plugged in. It shows “Serial Number: n/a on the screen when it displays: “iPad Recovery Mode To update your iPad without erasing its contents, click Update. To restore your iPad to its factory settings, click Restore iPad.
I prefer to update my iPad, but it displays “Your iPad can’t be updated, you must restore it to factory settings. If you previously backed up the iPad, click Restore Backup after the restore process completes.”
It’s a continuous loop. I get the display on my iPad to plug in the iPad to iTunes, plug it in which ends after going through the above procedure saying an error occurred (9).
So now I cannot use my iPad. When I turn it on I get the display showing me to plug it into iTunes with the cable. Since this is the only option I have I plug it in and the loop begins.
Any advice would be appreciated.
Thanks!Hello jaybearden,
Thanks for the question. After reviewing your post, it sounds like you are not able to restore the iOS device since you get an error 9. I would recommend that you read this article, it may be able to help the issue.
Resolve iOS update and restore errors - Apple Support
Check your security software
Related errors: 2, 4, 6, 9, 1000, 1611, 9006. Sometimes security software can prevent your device from communicating with either the Apple update server or with your device.
Check your security software and settings to make sure that they aren't preventing a connection to the Apple servers.
Thanks for using Apple Support Communities.
Have a nice day,
Mario -
I am using JSP and MYSQL with a bean that does my database work.
my search.jsp looks up records, when I click edit it sends the values to my inventory_admin.jsp
When I make the changes to the data, the data is not saved in the database.
Please, look see!
<!--search.jsp-->
<jsp:useBean id="inventoryBean" scope="session" class="mybeans.inventoryBean" />
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%// Do search with bean.
String s = request.getParameter("searchField");
int searchId = -1;
if(s != null)
try
searchId = Integer.parseInt(s);
catch(NumberFormatException e) {}
//Do actual search with bean
boolean rc = false;
if(searchId != -1)
rc = inventoryBean.findByPrimaryKey(searchId);
%>
<form action="search.jsp" method="post" enctype="application/x-www-form-urlencoded">
<h2 align="center">Software Inventory </h2>
<p align="center"> </p>
<p>Lookup:
<input name="searchField" type="text" id="searchField">
<input type="submit" name="Submit" value="Submit">
</p>
</form>
<%
//Output 'not found' message if needed
if(rc == false)
out.println("<P><B>Product not found</B></P>");
%>
<table width="25%" border="0">
<tr>
<td>Item ID:</td>
<td><jsp:getProperty name="inventoryBean" property="itemid" /></td>
</tr>
<tr>
<td>Product Name:</td>
<td><jsp:getProperty name="inventoryBean" property="item" /></td>
</tr>
<tr>
<td>Platform:</td>
<td><jsp:getProperty name="inventoryBean" property="platform" /></td>
</tr>
<tr>
<td>Serial:</td>
<td><jsp:getProperty name="inventoryBean" property="serial" /></td>
</tr>
<tr>
<td>Description:</td>
<td><jsp:getProperty name="inventoryBean" property="description" /></td>
</tr>
</table>
<p>&nosave=yes">EDIT</a></p>
<p align="center"> </p>
</body>
</html>
<!--inventory_admin.jsp-->
<jsp:useBean id="inventoryBean" scope="session" class="mybeans.inventoryBean" />
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%-- Copy all form variables at once into the bean--%>
<jsp:setProperty name="inventoryBean" property="*" />
<%
boolean saveResult = false;
boolean notSaved = false;
//Save our changes
String s = request.getParameter("nosave");
if(s == null || s.equals("yes") == false)
saveResult = inventoryBean.update();
else
notSaved = true;
//Do search with bean
s = request.getParameter("itemid");
int searchId = -1;
if(s != null)
try
searchId = Integer.parseInt(s);
catch(NumberFormatException e) {}
//Do actual search with Bean
boolean rc;
if(searchId != -1)
rc = inventoryBean.findByPrimaryKey(searchId);
%>
<h2 align="center">Software Inventory - Edit Mode</h2>
<FORM action="inventory_admin.jsp" method="post" enctype="application/x-www-form-urlencoded">
<table width="25%" border="0">
<tr>
<td>ITEMID</td>
<td><jsp:getProperty name="inventoryBean" property="itemid" /></td>
</tr
<tr>
<td>Product Name:</td>
<td><input name="description" type="text" value="<jsp:getProperty name="inventoryBean" property="item" />"></td>
</tr>
<tr>
<td>Platform:</td>
<td><input name="description" type="text" value="<jsp:getProperty name="inventoryBean" property="platform" />"></td>
</tr>
<tr>
<td>Serial:</td>
<td><input name="description" type="text" value="<jsp:getProperty name="inventoryBean" property="serial" />"></td>
</tr>
<tr>
<td>Description:</td>
<td><input name="description" type="text" value="<jsp:getProperty name="inventoryBean" property="description" />"></td>
</tr>
</table>
<%
if(notSaved == false)
if(saveResult == true)
out.println("Changes saved");
else
out.println("Changes NOT saved");
%>
<p><input type="submit" name="Submit" value="Submit"></p>
<p align="center"> </p>
</FORM>
</body>
</html>
//inventory.java
Here is the Bean Im using:
// inventoryBean.java - Simple database bean for table products
package mybeans; // Our custom 'package'.
import mybeans.DBConfigInfo; // Import helper classes
import mybeans.DBWorker; // for simpler database programming.
// Import other packages here.
import java.sql.*; // For database access.
import java.util.Hashtable; // For findRecords().
public class inventoryBean
private boolean isBeanDataValid = false; // Set when bean contains valid data.
private boolean isDBError = false; // Stores whether there was a processing error.
private String dbErrorMsg = "(No error)";
private DBWorker dbWorker; // Helper object for JDBC programming.
// Attributes
private String item = "";
private String platform = "";
private String serial = "";
private String description = "";
private int itemid = 0; // Primary key field
public void clear()
// Clears data in all your properties to 'empty' state.
item = "";
platform = "";
serial = "";
description = "";
itemid = 0; // Primary key field
// Accessor Methods
public void setItem(String newItem) { item = newItem; }
public String getItem() { return item; }
public void setPlatform(String newPlatform) { platform = newPlatform; }
public String getPlatform() { return platform; }
public void setSerial(String newSerial) { serial = newSerial; }
public String getSerial() { return serial; }
public void setDescription(String newDescription) { description = newDescription; }
public String getDescription() { return description; }
public void setItemid(int newItemid) { itemid = newItemid; }
public int getItemid() { return itemid; }
// Operations
// Default constructor.
public inventoryBean()
// Create a helper object to work with database.
// DO NOT DELETE THIS CODE.
dbWorker = new DBWorker();
// Database Operations
// Built-in methods:
public boolean findByPrimaryKey(int searchId)
// Use this method to find 1 record by primary key for your table.
// (After this call, all fields will be loaded into your properties.)
// Clear existing data, if any.
clear();
isBeanDataValid = false;
// Query by primary key.
boolean rc = dbWorker.open();
if(rc == false)
isDBError = true;
dbErrorMsg = dbWorker.errorMsg;
return false;
try
// 1) Get a connection.
Connection conn = dbWorker.getConnection();
// 2) Create a statement.
Statement st = conn.createStatement();
// 3) Build your SQL.
String sql = "SELECT item, platform, serial, description, " +
"itemid " +
"FROM products " +
"WHERE itemid=" + searchId;
//System.out.println("DEBUG SQL =" + sql);
// 4) Get a result set.
ResultSet rs = st.executeQuery(sql);
// 5) Move to first record
if(rs.next())
// 6) Retrieve fields into your properties using JDBC get??? methods.
item = rs.getString("item");
platform = rs.getString("platform");
serial = rs.getString("serial");
description = rs.getString("description");
itemid = rs.getInt("itemid");
// 7) Ensure non-null String fields with dbWorker.safeStr()
item = dbWorker.safeStr(item);
platform = dbWorker.safeStr(platform);
serial = dbWorker.safeStr(serial);
description = dbWorker.safeStr(description);
// Set result code.
isBeanDataValid = true;
// 8) Close all DB objects.
rs.close();
st.close();
dbWorker.close(); // Connection too.
catch(SQLException e)
System.out.println("Error in findByPrimaryKey (" + e.getMessage() + ")");
return isBeanDataValid;
// Update a record
public boolean update()
// Use this to update a record by a primary key.
boolean resultCode = false;
// Query by primary key.
boolean rc = dbWorker.open();
if(rc == false)
isDBError = true;
dbErrorMsg = dbWorker.errorMsg;
return false;
try // Remember to put all DB code inside a try block!
// 1) Get a connection.
Connection conn = dbWorker.getConnection();
// 2) Create a statement.
Statement st = conn.createStatement();
// 3) Build your SQL.
String sql = "UPDATE products SET item=" + dbWorker.sqlStr(item) + "," +
"platform=" + dbWorker.sqlStr(platform) + "," +
"serial=" + dbWorker.sqlStr(serial) + "," +
"description=" + dbWorker.sqlStr(description)+
" WHERE itemid=" + itemid;
//System.out.println("DEBUG SQL =" + sql);
// 4) Run action query.
int rowsAffected = st.executeUpdate(sql);
// 5) See if we succeeded (1 recorded affected).
if(rowsAffected == 1)
resultCode = true;
else
System.out.println("Warning: Can't update in update()!");
// 6) Close all DB objects.
st.close();
dbWorker.close(); // Connection too.
catch(SQLException e)
System.out.println("Error in update (" + e.getMessage() + ")");
return resultCode;
// Delete a record
public boolean delete(int deleteId)
// Use this to delete a record by a primary key.
boolean resultCode = false;
// Query by primary key.
boolean rc = dbWorker.open();
if(rc == false)
isDBError = true;
dbErrorMsg = dbWorker.errorMsg;
return false;
try
// 1) Get a connection.
Connection conn = dbWorker.getConnection();
// 2) Create a statement.
Statement st = conn.createStatement();
// 3) Build your SQL.
String sql = "DELETE FROM products WHERE itemid=" + deleteId;
//System.out.println("DEBUG SQL =" + sql);
// 4) Run action query.
int rowsAffected = st.executeUpdate(sql);
// 5) See if we succeeded (1 recorded affected).
if(rowsAffected == 1)
resultCode = true;
else
System.out.println("Warning: Can't delete ID #" + deleteId + " in delete()!");
// 6) Close all DB objects.
st.close();
dbWorker.close(); // Connection too.
catch(SQLException e)
System.out.println("Error in delete (" + e.getMessage() + ")");
return resultCode;
// Insert a new record.
public boolean insert(String newItem, String newPlatform, String newSerial, String newDescription,
int newItemid)
// Use this to update a record by a primary key.
boolean resultCode = false;
// Query by primary key.
boolean rc = dbWorker.open();
if(rc == false)
isDBError = true;
dbErrorMsg = dbWorker.errorMsg;
return false;
try // Remember to put all DB code inside a try block!
// 1) Get a connection.
Connection conn = dbWorker.getConnection();
// 2) Create a statement.
Statement st = conn.createStatement();
// 3) Build your SQL.
String sql="INSERT INTO products(item, platform, serial, description, " +
"itemid) " +
"VALUES(" + dbWorker.sqlStr(newItem) + "," + dbWorker.sqlStr(newPlatform) + "," + dbWorker.sqlStr(newSerial) + "," + dbWorker.sqlStr(newDescription) + "," +
newItemid + ")";
//System.out.println("DEBUG SQL =" + sql);
// 4) Run action query.
int rowsAffected = st.executeUpdate(sql);
// 5) See if we succeeded (1 recorded affected).
if(rowsAffected == 1)
resultCode = true;
else
System.out.println("Warning: Can't update in insert()!");
// 6) Close all DB objects.
st.close();
dbWorker.close(); // Connection too.
catch(SQLException e)
System.out.println("Error in insert (" + e.getMessage() + ")");
return resultCode;
public int findMaxPrimaryKey()
// Use this method to find the current max. value for a primary key
// in the database for a given table.
int retVal = -1;
// Query by primary key.
boolean rc = dbWorker.open();
if(rc == false)
isDBError = true;
dbErrorMsg = dbWorker.errorMsg;
return -1;
try // Remember to put all DB code inside a try block!
// 1) Get a connection.
Connection conn = dbWorker.getConnection();
// 2) Create a statement.
Statement st = conn.createStatement();
// 3) Build your SQL.
String sql = "SELECT MAX(itemid) FROM products";
//System.out.println("DEBUG SQL =" + sql);
// 4) Get a result set.
ResultSet rs = st.executeQuery(sql);
// 5) Move to first record
if(rs.next())
// 6) Retrieve fields into your properties using JDBC get??? methods.
retVal = rs.getInt(1); // Get first and only column.
// 7) Close all DB objects.
rs.close();
st.close();
dbWorker.close(); // Connection too.
catch(SQLException e)
System.out.println("Error in findMaxPrimaryKey (" + e.getMessage() + ")");
return retVal;
public Hashtable findRecords(String filter, String orderBy)
// Use this method to return a Hashtable filled with
// one or more records. You can specified a 'filter'
// for finding records and 'orderBy' will determine the sort order.
Hashtable retVal = new Hashtable();
retVal.put("ROWCOUNT", "0");
retVal.put("COLUMNCOUNT", "0");
retVal.put("STATUS", "EMPTY");
// Query by primary key.
boolean rc = dbWorker.open();
if(rc == false)
isDBError = true;
dbErrorMsg = dbWorker.errorMsg;
return retVal;
try // Remember to put all DB code inside a try block!
// 1) Get a connection.
Connection conn = dbWorker.getConnection();
// 2) Create a statement.
Statement st = conn.createStatement();
// 3) Build your SQL.
String sql = "SELECT item, platform, serial, description, " +
"itemid " +
"FROM products " +
"WHERE " + filter + " " +
"ORDER BY " + orderBy;
//System.out.println("DEBUG SQL =" + sql);
// 4) Get a result set.
ResultSet rs = st.executeQuery(sql);
int rowCount = 0;
// 5) Move to first record (and then next) record.
while(rs.next())
// 6) Retrieve fields into your properties using JDBC get??? methods.
String thisItem = rs.getString("item");
String thisPlatform = rs.getString("platform");
String thisSerial = rs.getString("serial");
String thisDescription = rs.getString("description");
int thisItemid = rs.getInt("itemid");
// 7) Ensure non-null String fields with dbWorker.safeStr()
thisItem = dbWorker.safeStr(thisItem);
thisPlatform = dbWorker.safeStr(thisPlatform);
thisSerial = dbWorker.safeStr(thisSerial);
thisDescription = dbWorker.safeStr(thisDescription);
// 8) Load this row into our Hashtable.
// The convention here is to pack each row's column name with an ID
// indicating the row. "ProjectId" + "0" = "ProjectId0" ===mapped to===> Value
// Put this record into Hashtable.
retVal.put("item" + rowCount, thisItem);
retVal.put("platform" + rowCount, thisPlatform);
retVal.put("serial" + rowCount, thisSerial);
retVal.put("description" + rowCount, thisDescription);
retVal.put("itemid" + rowCount, "" + thisItemid);
rowCount++;
// 9) Close all DB objects.
rs.close();
st.close();
dbWorker.close(); // Connection too.
// Write info to our hashtable--Since this container hold virtually anything,
// you can put in whatever 'metadata' you want about your result set.
retVal.put("ROWCOUNT", "" + rowCount);
retVal.put("COLUMNCOUNT", "5");
retVal.put("STATUS", "OK");
catch(SQLException e)
System.out.println("Error in findRecords (" + e.getMessage() + ")");
retVal.put("STATUS", "ERROR");
return retVal;
//============================================================
// DO NOT CHANGE THE CODE BELOW.
//============================================================
public boolean isValid()
// Does bean contain real data?
return isBeanDataValid;
public boolean isError()
// Returns true if there was a DB error.
return isDBError;
public String getErrorMsg()
// Returns error message, if any.
return dbErrorMsg;
//=====================================================================
// TODO: Remember to comment out main() with /* */ for production code!
//=====================================================================
// TEST DRIVER CODE
public static void main(String[] args)
// Test driver code goes here.
String beanName = "inventoryBean";
String tableName = "products";
boolean isDataValidationError = false;
// Exercise CRUD functionality of this bean.
System.out.println("==============================================================");
System.out.println("Starting Test Driver for bean " + beanName + "....");
System.out.println("==============================================================");
// Create bean.
inventoryBean myBean = new inventoryBean();
// Create a new record.
int newId = myBean.findMaxPrimaryKey();
newId++;
boolean rc = myBean.insert("e", "t", "g", "R",
newId);
if(rc)
System.out.println("SUCCESS: Inserted new record #= " + newId + ".");
else
System.out.println("ERROR! Can't insert record #= " + newId + ".");
System.out.println("====================================================");
System.out.println("VALIDATION FAILED: Test driver generated an error.");
System.out.println("====================================================");
return;
// Retrieve a record
rc = myBean.findByPrimaryKey(newId);
if(rc)
System.out.println("SUCCESS: Record #" + newId + " found.");
else
System.out.println("====================================================");
System.out.println("VALIDATION FAILED: Test driver generated an error.");
System.out.println("====================================================");
System.out.println("ERROR! Record #" + newId + " NOT found.");
// Simulate using set??? accessor methods with test data.
// (Note: We don't change the primary key.)
int testItemid = newId;
System.out.println("Testing set???() accessor methods....");
System.out.println("Setting Record #" + newId + " to:");
System.out.println(" inventoryBean.setItem(testItem); // = R");
myBean.setItem(testItem);
System.out.println(" inventoryBean.setPlatform(testPlatform); // = Y");
myBean.setPlatform(testPlatform);
System.out.println(" inventoryBean.setSerial(testSerial); // = E");
myBean.setSerial(testSerial);
System.out.println(" inventoryBean.setDescription(testDescription); // = k");
myBean.setDescription(testDescription);
System.out.println(" inventoryBean.setItemid(testItemid); // = " + newId);
myBean.setItemid(testItemid);
// Call update.
rc = myBean.update();
if(rc)
System.out.println("SUCCESS: Record #" + newId + " updated.");
else
System.out.println("ERROR! Record #" + newId + " NOT updated.");
System.out.println("====================================================");
System.out.println("VALIDATION FAILED: Test driver generated an error.");
System.out.println("====================================================");
return;
// Requery and validate each field.
rc = myBean.findByPrimaryKey(newId);
if(rc)
System.out.println("SUCCESS: Updated Record #" + newId + " found.");
else
System.out.println("====================================================");
System.out.println("VALIDATION FAILED: Test driver generated an error.");
System.out.println("====================================================");
System.out.println("ERROR! Record #" + newId + " NOT found");
// Simulate using get??? accessor methods.
// Validate updated values against test values.
System.out.println("Validating Record #" + newId + ":");
String testData;
String actualItem = myBean.getItem();
testData = "R";
if(testData.equals(actualItem))
System.out.println(" OK: inventoryBean.getItem() = actualItem");
else
System.out.println(" ERROR! inventoryBean.getItem() returned [" + actualItem + "] instead of [R]");
isDataValidationError = true;
String actualPlatform = myBean.getPlatform();
testData = "Y";
if(testData.equals(actualPlatform))
System.out.println(" OK: inventoryBean.getPlatform() = actualPlatform");
else
System.out.println(" ERROR! inventoryBean.getPlatform() returned [" + actualPlatform + "] instead of [Y]");
isDataValidationError = true;
String actualSerial = myBean.getSerial();
testData = "E";
if(testData.equals(actualSerial))
System.out.println(" OK: inventoryBean.getSerial() = actualSerial");
else
System.out.println(" ERROR! inventoryBean.getSerial() returned [" + actualSerial + "] instead of [E]");
isDataValidationError = true;
String actualDescription = myBean.getDescription();
testData = "k";
if(testData.equals(actualDescription))
System.out.println(" OK: inventoryBean.getDescription() = actualDescription");
else
System.out.println(" ERROR! inventoryBean.getDescription() returned [" + actualDescription + "] instead of [k]");
isDataValidationError = true;
int actualItemid = myBean.getItemid();
if(actualItemid == newId)
System.out.println(" OK: inventoryBean.getItemid() = actualItemid");
else
System.out.println(" ERROR! inventoryBean.getItemid() returned [" + actualItemid + "] instead of [" + newId + "]");
isDataValidationError = true;
// Cleanup with delete.
rc = myBean.delete(newId);
if(rc)
System.out.println("SUCCESS: Record #" + newId + " deleted.");
else
System.out.println("ERROR! Record #" + newId + " NOT deleted.");
// Now test out findRecords() for up to 100 records.
Hashtable data = myBean.findRecords("itemid > 0", "itemid");
String s = (String)data.get("STATUS");
if(s != null && s.equals("OK"))
s = (String)data.get("ROWCOUNT");
int rowCount = Integer.parseInt(s);
if(rowCount > 100) // Just output first 100 records.
rowCount = 100;
System.out.println("SUCCESS: Returning " + rowCount + " records (100 max.) using findRecords():");
for(int i = 0; i < rowCount; i++)
System.out.println(" Row #" + i + "=" +
data.get("item" + i) + ", " +
data.get("platform" + i) + ", " +
data.get("serial" + i) + ", " +
data.get("description" + i) + ", " +
data.get("itemid" + i));
else
System.out.println("ERROR! No rows returned using findRecords()!");
System.out.println("====================================================");
System.out.println("VALIDATION FAILED: Test driver generated an error.");
System.out.println("====================================================");
return;
if(isDataValidationError == false)
// Print final success message.
System.out.println("================================================================================");
System.out.println("VALIDATION SUCCESS! Bean " + beanName + " passed all automated tests.");
System.out.println("================================================================================");
else
System.out.println("====================================================================================");
System.out.println("ERROR! Tests completed but bean " + beanName + " had a data validation error.");
System.out.println("====================================================================================");Couple of pointers.
1 - use [ code ] tags to post code
2 - that is WAY too much code for more than a cursory glance. You're lucky the problem was easy to spot.
Your problem lies in your edit JSP form:
<td>Product Name:</td>
<td><input name="description" type="text" value="<jsp:getProperty name="inventoryBean" property="item" />"></td>Note that the name of the input field is different from the jsp property you are populating it with.
In fact, all of your input fields have a name of "description"
I would recommend on your inventory_admin.jsp page that you put the following debugging code to make sure that the parameter values come through and are set correctly.
out.println("name = param: " + request.getParameter("name") + "bean = " + inventoryBean.getName() + "<BR>");
out.println("description = param:" + request.getParameter("description") + "bean = " + inventoryBean.getDescription() + "<BR>");
...
Maybe you are looking for
-
How do I delete files from my 21 TB SimpleSave Drive?
My sim;le save 1 TB drive cannot back up anymore because it is full. i can't find where to delete data.
-
Bridge and PS not communicating with scripts and automation.
CS4 PS and Bridge is not communicating correctly. When opening an image from Bridge it opens whiteout any issues but when choosing Tools and PS and any form of automation or script it will not open and start the requested action. Then when choosing s
-
HOW TO STOP THE PROCESS CHAIN WHICH IS RUNNING IN THE PRODUCTION?
HI ALL, CAN ANYONE TELL ME HOW TO STOP THE PROCESS CHAIN WHICH IS RUNNING DAILY AT 5.00 PM. I NEED TO STOP THE PROCESS CHAIN FOR COUPLE OF DAYS AND THEN RESTART IT AGAIN. cAN ANYONE TELL ME THE PROCEDURE TO STOP THE ENTIRE PROCESS CHAIN RUNNING IN TH
-
Hi, I have been using Aperture 3 for almost a year now, still learning but enjoying it very much. I would like to either purchase some Plug-In Software or download it. Something to have some fun with, with some of the photos. I don't need profession
-
New itunes makes ipod unable to connect
I am having trouble with my 2gen ipod that uses firewire which until the upgrade to version 7.6 i can't even get my ipod to start in windows the ipod says on it that it is ok to disconnect and device manager sees it but says device will not start. th