Problem updating data into ms access database
Hi! I need to update a database based on user's entries. But I have a problem with the updating code. Can some1 help? Here is my whole servlet's code :
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
public class editstaff extends HttpServlet
static Connection link;
static Statement statement;
static ResultSet results;
public void doPost(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException
response.setContentType("text/HTML");
PrintWriter out = response.getWriter();
out.println("<HTML>");
out.println("<HEAD>");
out.println("<TITLE>Edit Staff Particulars</TITLE>");
out.println("</HEAD>");
out.println("<BR><BR>");
out.println("<BODY>");
String staff = request.getParameter("name");
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
link = DriverManager.getConnection("jdbc:odbc:occ","","");
catch(ClassNotFoundException e)
System.out.println("Sorry! Unable to load driver. Pls try again later.");
System.exit(1);
catch(SQLException e)
System.out.println("Sorry! Unable to connect to the database. Pls try again later.");
System.exit(1);
try
statement=link.createStatement();
String select = "SELECT * FROM Staff WHERE Name = '" + staff+"'";//name taken from html page
results = statement.executeQuery(select);
out.println("<table border=1>");
out.println("<tr>");
out.println("<th bgcolor=orchid>Name</th>");
out.println("<th bgcolor=orchid>IC</th>");
out.println("<th bgcolor=orchid>Staff_ID</th>");
out.println("<th bgcolor=orchid>Date_Joined</th>");
out.println("<th bgcolor=orchid>Address</th>");
out.println("<th bgcolor=orchid>Date_of_Birth</th>");
out.println("<th bgcolor=orchid>Designation</th>");
out.println("<th bgcolor=orchid>Driving_License</th>");
out.println("<th bgcolor=orchid>Mobile</th>");
out.println("<th bgcolor=orchid>Home_Tel</th>");
out.println("<th bgcolor=orchid>E-mail</th>");
out.println("<th bgcolor=orchid>Section</th>");
out.println("<th bgcolor=orchid>Department</th>");
out.println("<th bgcolor=orchid>Course</th>");
out.println("<th bgcolor=orchid>Date_Trained</th>");
out.println("<th bgcolor=orchid>Recurrent_Date</th>");
out.println("<th bgcolor=orchid>Proficiency</th>");
while (results.next())
out.println("<tr>");
out.println("<td>");
out.println(results.getString(1));
out.println("</td>");
out.println("<td>");
out.println(results.getString(8));
out.println("</td>");
out.println("<td>");
out.println(results.getString(9));
out.println("</td>");
out.println("<td>");
out.println(results.getString(16));
out.println("</td>");
out.println("<td>");
out.println(results.getString(4));
out.println("</td>");
out.println("<td>");
out.println(results.getString(6));
out.println("</td>");
out.println("<td>");
out.println(results.getString(10));
out.println("</td>");
out.println("<td>");
out.println(results.getString(7));
out.println("</td>");
out.println("<td>");
out.println(new Integer(results.getString(2)));
out.println("</td>");
out.println("<td>");
out.println(new Integer(results.getString(3)));
out.println("</td>");
out.println("<td>");
out.println(results.getString(5));
out.println("</td>");
out.println("<td>");
out.println(results.getString(17));
out.println("</td>");
out.println("<td>");
out.println(results.getString(11));
out.println("</td>");
out.println("<td>");
out.println(results.getString(12));
out.println("</td>");
out.println("<td>");
out.println(results.getString(13));
out.println("</td>");
out.println("<td>");
out.println(results.getString(14));
out.println("</td>");
out.println("<td>");
out.println(results.getString(15));
out.println("</td>");
out.println("</tr>");
out.println("</table>");
out.println("<BR><BR><BR>");
out.println("<table border=1>");
out.println("<tr>");
out.println("<th>Name</th>");
out.println("<td><input name=nam type=text id=nam></td>");
out.println("</tr>");
out.println("<tr>");
out.println("<th>IC number</th>");
out.println("<td><input name=ic type=text id=ic></td>");
out.println("</tr>");
out.println("<tr>");
out.println("<th>Staff ID</th>");
out.println("<td><input name=ID type=text id=ID></td>");
out.println("</tr>");
out.println("<tr>");
out.println("<th>Date Joined</th>");
out.println("<td>");
out.println("<select name=jday size=1 id=jday>");
out.println("<option>1</option>");
out.println("<option>2</option>");
out.println("<option>3</option>");
out.println("<option>4</option>");
out.println("<option>5</option>");
out.println("<option>6</option>");
out.println("<option>7</option>");
out.println("<option>8</option>");
out.println("<option>9</option>");
out.println("<option>10</option>");
out.println("<option>11</option>");
out.println("<option>12</option>");
out.println("<option>13</option>");
out.println("<option>14</option>");
out.println("<option>15</option>");
out.println("<option>16</option>");
out.println("<option>17</option>");
out.println("<option>18</option>");
out.println("<option>19</option>");
out.println("<option>20</option>");
out.println("<option>21</option>");
out.println("<option>22</option>");
out.println("<option>23</option>");
out.println("<option>24</option>");
out.println("<option>25</option>");
out.println("<option>26</option>");
out.println("<option>27</option>");
out.println("<option>28</option>");
out.println("<option>29</option>");
out.println("<option>30</option>");
out.println("<option>31</option>");
out.println("</select>");
out.println("<select name=jmth size=1 id-jmth>");
out.println("<option>January</option>");
out.println("<option>February</option>");
out.println("<option>March</option>");
out.println("<option>April</option>");
out.println("<option>May</option>");
out.println("<option>June</option>");
out.println("<option>July</option>");
out.println("<option>August</option>");
out.println("<option>September</option>");
out.println("<option>October</option>");
out.println("<option>November</option>");
out.println("<option>December</option>");
out.println("</select>");
out.println("<select name=jyear size=1 id=jyear");
out.println("<option>2004</option>");
out.println("<option>2005</option>");
out.println("<option>2006</option>");
out.println("<option>2007</option>");
out.println("<option>2008</option>");
out.println("<option>2009</option>");
out.println("<option>2010</option>");
out.println("<option>2011</option>");
out.println("<option>2012</option>");
out.println("<option>2013</option>");
out.println("<option>2014</option>");
out.println("</select></td></tr>");
out.println("<tr><th>Address</th>");
out.println("<td><textarea name=add id=add></textarea></td></tr>");
out.println("<tr><th>Date of Birth");
out.println("<td>");
out.println("<select name=bday size=1 id=bday>");
out.println("<option>1</option>");
out.println("<option>2</option>");
out.println("<option>3</option>");
out.println("<option>4</option>");
out.println("<option>5</option>");
out.println("<option>6</option>");
out.println("<option>7</option>");
out.println("<option>8</option>");
out.println("<option>9</option>");
out.println("<option>10</option>");
out.println("<option>11</option>");
out.println("<option>12</option>");
out.println("<option>13</option>");
out.println("<option>14</option>");
out.println("<option>15</option>");
out.println("<option>16</option>");
out.println("<option>17</option>");
out.println("<option>18</option>");
out.println("<option>19</option>");
out.println("<option>20</option>");
out.println("<option>21</option>");
out.println("<option>22</option>");
out.println("<option>23</option>");
out.println("<option>24</option>");
out.println("<option>25</option>");
out.println("<option>26</option>");
out.println("<option>27</option>");
out.println("<option>28</option>");
out.println("<option>29</option>");
out.println("<option>30</option>");
out.println("<option>31</option>");
out.println("</select>");
out.println("<select name=bmth size=1 id=bmth>");
out.println("<option>January</option>");
out.println("<option>February</option>");
out.println("<option>March</option>");
out.println("<option>April</option>");
out.println("<option>May</option>");
out.println("<option>June</option>");
out.println("<option>July</option>");
out.println("<option>August</option>");
out.println("<option>September</option>");
out.println("<option>October</option>");
out.println("<option>November</option>");
out.println("<option>December</option>");
out.println("</select>");
out.println("<select name=byear size=1 id=byear>");
out.println("<option>1946</option>");
out.println("<option>1947</option>");
out.println("<option>1948</option>");
out.println("<option>1949</option>");
out.println("<option>1950</option>");
out.println("<option>1951</option>");
out.println("<option>1952</option>");
out.println("<option>1953</option>");
out.println("<option>1954</option>");
out.println("<option>1955</option>");
out.println("<option>1956</option>");
out.println("<option>1957</option>");
out.println("<option>1958</option>");
out.println("<option>1959</option>");
out.println("<option>1960</option>");
out.println("<option>1961</option>");
out.println("<option>1962</option>");
out.println("<option>1963</option>");
out.println("<option>1964</option>");
out.println("<option>1965</option>");
out.println("<option>1966</option>");
out.println("<option>1967</option>");
out.println("<option>1968</option>");
out.println("<option>1969</option>");
out.println("<option>1970</option>");
out.println("<option>1980</option>");
out.println("<option>1981</option>");
out.println("<option>1982</option>");
out.println("<option>1983</option>");
out.println("<option>1984</option>");
out.println("<option>1985</option>");
out.println("<option>1986</option>");
out.println("<option>1989</option>");
out.println("<option>1990</option>");
out.println("</select></td></tr>");
out.println("<tr><th>Designation</th>");
out.println("<td><input name=designation type=text id=designation></td></tr>");
out.println("<tr><th>Driving License</th>");
out.println("<td>");
out.println("<select name=license size=1 multiple=multiple id=license>");
out.println("<option>Class 3</option>");
out.println("<option>Class 4</option>");
out.println("<option>Class 5</option>");
out.println("</select></td></tr>");
out.println("<tr><th>Mobile</th>");
out.println("<td><input name=mobile type=text id=mobile></td></tr>");
out.println("<tr><th>Home Tel</th>");
out.println("<td><input name=home type=text id=home></td></tr>");
out.println("<tr><th>E-mail Address</th>");
out.println("<td><input name=email type=text id=email</td></tr>");
out.println("</tr><th>Section</th>");
out.println("<td>");
out.println("<select name=section size=1 id=section>");
out.println("<option>Ramp</option>");
out.println("<option>Baggage</option>");
out.println("<option>Service Asisstants</option>");
out.println("<option>Flight Coordinators</option>");
out.println("</select></td>");
out.println("<th>Department</th>");
out.println("<td>");
out.println("<select name=dept size=1 id=dept>");
out.println("<option>PAX</option>");
out.println("<option>Ramp</option>");
out.println("<option>Cargo</option>");
out.println("</select></td>");
out.println("<th>Course</th>");
out.println("<td>");
out.println("<select name=course size=1 multiple=multiple id=course>");
out.println("<option>Ramp Safety</option>");
out.println("<option>Dangerous Goods</option>");
out.println("<option>Security Training</option>");
out.println("</select></td></tr>");
out.println("<tr><th>Date Trained</th>");
out.println("<td>");
out.println("<select name=tday size=1 id=tday>");
out.println("<option>1</option>");
out.println("<option>2</option>");
out.println("<option>3</option>");
out.println("<option>4</option>");
out.println("<option>5</option>");
out.println("<option>6</option>");
out.println("<option>7</option>");
out.println("<option>8</option>");
out.println("<option>9</option>");
out.println("<option>10</option>");
out.println("<option>11</option>");
out.println("<option>12</option>");
out.println("<option>13</option>");
out.println("<option>14</option>");
out.println("<option>15</option>");
out.println("<option>16</option>");
out.println("<option>17</option>");
out.println("<option>18</option>");
out.println("<option>19</option>");
out.println("<option>20</option>");
out.println("<option>21</option>");
out.println("<option>22</option>");
out.println("<option>23</option>");
out.println("<option>24</option>");
out.println("<option>25</option>");
out.println("<option>26</option>");
out.println("<option>27</option>");
out.println("<option>28</option>");
out.println("<option>29</option>");
out.println("<option>30</option>");
out.println("<option>31</option>");
out.println("</select>");
out.println("<select name=tmth size=1 id=tmth>");
out.println("<option>January</option>");
out.println("<option>February</option>");
out.println("<option>March</option>");
out.println("<option>April</option>");
out.println("<option>May</option>");
out.println("<option>June</option>");
out.println("<option>July</option>");
out.println("<option>August</option>");
out.println("<option>September</option>");
out.println("<option>October</option>");
out.println("<option>November</option>");
out.println("<option>December</option>");
out.println("</select>");
out.println("<select name=tyear size=1 id=tyear>");
out.println("<option>2005</option>");
out.println("<option>2006</option>");
out.println("<option>2007</option>");
out.println("<option>2008</option>");
out.println("<option>2009</option>");
out.println("<option>2010</option>");
out.println("<option>2011</option>");
out.println("<option>2012</option>");
out.println("<option>2013</option>");
out.println("<option>2014</option>");
out.println("<option>2015</option>");
out.println("</select></td></tr>");
out.println("<tr><th>Recurrent Date</th>");
out.println("<td>");
out.println("<select name=rday size=1 id=rday>");
out.println("<option>1</option>");
out.println("<option>2</option>");
out.println("<option>3</option>");
out.println("<option>4</option>");
out.println("<option>5</option>");
out.println("<option>6</option>");
out.println("<option>7</option>");
out.println("<option>8</option>");
out.println("<option>9</option>");
out.println("<option>10</option>");
out.println("<option>11</option>");
out.println("<option>12</option>");
out.println("<option>13</option>");
out.println("<option>14</option>");
out.println("<option>15</option>");
out.println("<option>16</option>");
out.println("<option>17</option>");
out.println("<option>18</option>");
out.println("<option>19</option>");
out.println("<option>20</option>");
out.println("<option>21</option>");
out.println("<option>22</option>");
out.println("<option>23</option>");
out.println("<option>24</option>");
out.println("<option>25</option>");
out.println("<option>26</option>");
out.println("<option>27</option>");
out.println("<option>28</option>");
out.println("<option>29</option>");
out.println("<option>30</option>");
out.println("<option>31</option>");
out.println("</select>");
out.println("<select name=rmth size=1 id=rmth>");
out.println("<option>January</option>");
out.println("<option>February</option>");
out.println("<option>March</option>");
out.println("<option>April</option>");
out.println("<option>May</option>");
out.println("<option>June</option>");
out.println("<option>July</option>");
out.println("<option>August</option>");
out.println("<option>September</option>");
out.println("<option>October</option>");
out.println("<option>November</option>");
out.println("<option>December</option>");
out.println("</select>");
out.println("<select name=ryear size=1 id=ryear>");
out.println("<option>2005</option>");
out.println("<option>2006</option>");
out.println("<option>2007</option>");
out.println("<option>2008</option>");
out.println("<option>2009</option>");
out.println("<option>2010</option>");
out.println("<option>2011</option>");
out.println("<option>2012</option>");
out.println("<option>2013</option>");
out.println("<option>2014</option>");
out.println("<option>2015</option>");
out.println("</select></td></tr>");
out.println("<tr><th>Proficiency</th>");
out.println("<td><input name=prof type=text id=prof</td></tr>");
out.println("</table>");
out.println("<p align=right>");
out.println("<input type=submit name=submit value=Submit>");
out.println("<input type=reset name=reset value=Reset>");
out.println("</p>");
String nam = request.getParameter("nam");
String ic = request.getParameter("IC");
String jday = request.getParameter("jday");
String jmth = request.getParameter("jmth");
String jyear = request.getParameter("jyear");
String mobile = request.getParameter("mobile");
String home = request.getParameter("home");
String add = request.getParameter("add");
String email = request.getParameter("email");
String day = request.getParameter("day");
String mth = request.getParameter("mth");
String year = request.getParameter("year");
String designation = request.getParameter("designation");
String dept = request.getParameter("dept");
String ID = request.getParameter("ID");
String license = request.getParameter("license");
String course = request.getParameter("course");
String tday = request.getParameter("tday");
String tmth = request.getParameter("tmth");
String tyear = request.getParameter("tyear");
String rday = request.getParameter("rday");
String rmth = request.getParameter("rmth");
String ryear = request.getParameter("ryear");
String prof = request.getParameter("prof");
String sect = request.getParameter("job");
String dob = ""+day+"-"+mth+"-"+year+"";
String train = ""+tday+"-"+tmth+"-"+tyear+"";
String date = ""+jday+"-"+jmth+"-"+jyear+"";
String recurrent = ""+rday+"-"+rmth+"-"+ryear+"";
String name = request.getParameter("name");
String change = "UPDATE Staff SET Name='"+nam+"',Mobile='"+mobile+"',Home='"+home+"',"
+"Address='"+add+"',E-mail='"+email+"',DOB='"+dob+"',Driving License='"+license+"',IC='"+ic+"',"
+"Staff ID='"+ID+"',Designation='"+designation+"',Department='"+dept+"',Course='"+course+"',"
+"Date Trained='"+train+"',Recurrent Date='"+recurrent+"',Proficiency='"+prof+"',"
+"Date Joined='"+date+"',Section'"+sect+"' WHERE Name='"+name+"'";//name taken from html page
results = statement.executeQuery(change);
catch(SQLException e)
System.out.println("Sorry! Unable to update data. Pls try again later.");
e.printStackTrace();
System.exit(1);
try
out.println("<br />");
out.println("</font></BODY>");
out.println("</HTML>");
out.flush();
link.close();
catch(SQLException e)
System.out.println("Sorry! Unable to execute query. Pls try again later.");
e.printStackTrace();
System.exit(1);
hi,
For Select Query there is Method executeQuery();
For insert, update, delete executeUpdate() is use
so try with executeUpdate()
and it will return how much row are updated.
Similar Messages
-
How to insert date into ms access database using sql query in servlet
sir all thing is working well now only tell me how we can insert date into ms access database which is input by user .
insert into db2(bookname,studentname,date) values('"+bname+"','"+sname+"',date_format)";{code}
or either the system date is inserted with query .
plz help me
thanxbhavishya wrote:
sir all thing is working well now only tell me how we can insert date into ms access database which is input by user .
insert into db2(bookname,studentname,date) values('"+bname+"','"+sname+"',date_format)";{code}
or either the system date is inserted with query .
plz help me
thanxAnd that SQL statement is another reason to use PreparedStatement. I assume bname and sname are input from some form? Well, if that's the case, simply inserting them into SQL by simple String concatenation is just begging for all sorts of problems. What if there is an apostrophe in the entry? Broken Statement. Worse, it's a wide open invitation to an SQL Injection attack. -
I can insert data into an access database, now I need to do some simple querries such as selecting all records that are greater than a certain value or = a certain value. How can I return only the selected records?
If you don't want to spend any money, then instead of ActiveX, I would recomend LabSQL from Jeffrey Travis. I use it instead of the Connectivity toolkit and have had no problems. Besides being free, you have the advantage of being able to use it with any database. ActiveX ties you to Access and you upgrade your version of Access and find the properties and methods are different, you've got a lot of reprogramming to do.
-
Need to archive Oracle data into MS Access database
Gurus,
I've been tasked with archiving several large tables (10 million records) into an MS Access database. I'm looking through MS Access help guide which states that I can use the ODBC driver to create table, column definitions, and import data.
Does anyone have any good resources on creating an ODBC driver for MS Access. Also, any reference material would be greatly appreciated.
Thanks
Scottsreese wrote:
Gurus,
I've been tasked with archiving several large tables (10 million records) into an MS Access database. On the face of it, that is an astoundingly bad idea. Using the worst database product (I can't even really refer to it as an RDBMS) on the planet to archive data that is already in the best RDBMS on the planet?
What does the person who came up with this idea expect to achieve?
I'm looking through MS Access help guide which states that I can use the ODBC driver to create table, column definitions, and import data. ODBC drivers don't create anything. They provide a common link between ODBC enabled apps and the native db interface.
>
Does anyone have any good resources on creating an ODBC driver for MS Access. You don't create the driver. It is provided by either MS or Oracle (they both have them). You just configure a connection definition (aka "Data Source Name" or DSN) that utilizes it.
Also, any reference material would be greatly appreciated.
Thanks
Scott -
How To Insert Data into a Access Database from a PDF File
Hi All,
Could anyone help me to insert PDF form data to an MS Access database.I am new to this and I would appreciate if anyone can help me at the earliest.
Thanks,
DeeptiYou can submit your PDF to a server-side script (ASP/PHP), and store the new record in a MS Access database.
For more information on how to store your PDF submission in a database, please visit:
http://www.fdftoolkit.net -
What is the best way to put LabVIEW DSC data into an Oracle database?
I have been collecting data using LabVIEW DSC 7.0 for several years and have always accessed the data from the Citadel database via the Historical Data Viewer. I would now like to begin putting this data into an Oracle database. My company stores all their data in Oracle and it would provide me all the benefits of their existing infrastructure such as automated backups, data mining tools, etc.
My initial thought is to use "Read Trace.vi" in LabVIEW to pull historical data from the citadel database at regular intervals (e.g. 1 minute) and insert this data into Oracle via ODBC. In this way, I do not need to track the value changes in order to know when to write to Oracle. I also considered replicating the citadel database using some other method, but I recall that the tables used by citadel are somewhat complicated. I only need a simple table with columns for channel, timestamp, and data. The "Read Trace.vi" will provide me data in this format.
I do not need to update the Oracle database in real time, a few minute delay is acceptable. If anyone has a better idea or additional insight please let me know. Thanks.In terms of connectivity, you want to use ADO, not ODBC. Beyond that, it all depends on the structure of the data and what you are going to want to do with it. This is a very big question that you need to be getting some in-depth assistance.
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps -
Problem finding data in an Oracle Database using CMP beans
I am having a problem retrieving data from an Oracle database that has a date as
part of the key. This data was loaded into my database via a batch process writing
in java using java.sql.Date to store the date information. When calling the findByPrimaryKey
method of a CMP Entity Bean I continued to get the FinderException. I know this
data is in my database because I can view the data via SQLPlus and Microsoft Access.
Has anyone ever experience problems with CMP beans accessing data from an Oracle
database that had a date as part if the key or with accessing data in the database
that insert via another method outside of your CMP bean. I desperately need some
answers.Hi Dave,
You should probably post this type of question in the CMP or JDBC section
for best results. Chances are that the date is suffering from a rounding
problem (it could be a date/time in the database with a different time zone)
or is not the date that you think it is (wrong century or millenium). I've
seen both. You need to write a quick piece of code that loads in those
values as both Java timestamps and dates and makes sure that they are what
you think they are.
Peace,
Cameron Purdy
Tangosol Inc.
Tangosol Coherence: Clustered Coherent Cache for J2EE
Information at http://www.tangosol.com/
"Dave White" <[email protected]> wrote in message
news:3c1a4ac3$[email protected]..
>
I am having a problem retrieving data from an Oracle database that has adate as
part of the key. This data was loaded into my database via a batchprocess writing
in java using java.sql.Date to store the date information. When callingthe findByPrimaryKey
method of a CMP Entity Bean I continued to get the FinderException. Iknow this
data is in my database because I can view the data via SQLPlus andMicrosoft Access.
Has anyone ever experience problems with CMP beans accessing data from anOracle
database that had a date as part if the key or with accessing data in thedatabase
that insert via another method outside of your CMP bean. I desperatelyneed some
answers. -
Xml data into non-xml database.. solution anyone?
Hi,
My current project requires me to store the client's data on our servers. We're using Oracle9i. Daily, I will download the client's data for that day and load it into our database. My problem is that the data file is not a flat file so I can't use sql*loader to load the data. Instead, the data file is an xml file. What is the best way to load xml data into a non-xml database? Are there any tools similar to sql*Loader that will load xml data into non-xml database? Is it the best solution for the client to give me an XML dump of their data to load into our database, or should I request a flat file? My last resort would be to write some sort of a script to parse the xml data into a flat file, and then run it through sql*loader. Is this the best solution? One thing to note is that these files could be very large.
Thanks in advance.
-PVI assume that just putting the XML file into an
extremely large VARCHAR field is not what you want.
Instead, you want to extract data elements from the
XML and write them to columns in a table in your
database. Right?Yes. Your assumption is correct.
It sounds like you already have a script that loads a
flat file into your database. In that case I would
write an XSL transformation that converts the client's
XML into a correctly-formatted flat file.Thank you. I'll look into that. Other suggestions are welcome. -
Different ways to download data into a Oracle database
Apart from the below are there any other ways to download data into an Oracle database ?
1. Import data using import/export features.
2. Oracle external tables.
3. Data Pump
4. SQL Loader.
5. PL/SQL => utl_file package.
6. Oracle SQL developer tool - it was a nice surprise this morning to know that this tool can be used to import data into Oracle database.
Thanks
GonyI will be able to do that once I complete my transition into an Oracle DBA
Next Great DBA
I downloaded oracle to my laptop today.
I will become the next great DBA.
No need for education or taking a course,
I'll use the forum and learn by brute force.
The guru's won't mind, they know it all
They are so profound, their ego's enthrall.
They have it written by steps 1 through 10.
If I don't get it once, I'll just ask it again.
I won't write it down, seems simple enough
After all, I've used Access with SQL and stuff.
Why you upset? Why you tell me to read?
I've no time for a manual, No Sir, Indeed!
Why waste my time with a book or a link,
I have this forum, no need to think.
I have no work history, just out of college,
But I'm smarter than those who are three times my age.
I'll become certified with an OCP,
Have you the answers, just give them to me.
Then we'll be equal just wait and see!
But, Why are you paid 100K more than me?Edited by: sb92075 on Jul 12, 2009 7:57 AM -
Regarding updating data into ztable
hi all,
When i am updating data into ztable .
Old record is deleted and new record is created
What will be the problem.
Please suggest.
Regards
RamiHi,
pz use ur syntax this way.
UPDATE zo9_user_status
SET sub_date = sy-datum
sub_time = sy-uzeit
status = g_wa_outtab-status
WHERE representative = g_wa_outtab-representative AND
selection_id = g_wa_outtab-selection_id AND
sub_date = g_wa_outtab-sub_date AND
sub_time = g_wa_outtab-sub_time AND
superior = g_wa_outtab-superior.
IF sy-subrc EQ 0.
COMMIT WORK.
l_error = 'X1'.
ELSE.
l_error = 'X2'.
CLEAR l_error.
ROLLBACK WORK.
ENDIF.
hope this helps.
thanx. -
Retrieve data from MS Access database.
Hi all,
The following is part of my coding. Once I have clicked the jButton1, the jTextField1 will get the input of user and store into a variable named "bbb". After that the variable will be passed to a function as a parameter to retrieve data from MS Access database using the ResultSet method. Next, the ResultSet will be splited into many part and just the student ic will be displayed.
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
String bbb = jTextField1.getText(); //get input from user and store into a variable named bbb
ResultSet codes = getCodes(bbb); //Retrieve data from database
Code c = getCode (codes); //split the retireved date to many part
jLabel2.setText(c.ic); //display the student ic only
private static ResultSet getCodes(String bbb)
Connection con = getConnection();
try
Statement s = con.createStatement();
String select = "SELECT [Student-File].* " + "FROM [Student-File] WHERE (([Student-File].[student-code])=bbb); " ;
ResultSet rows;
rows = s.executeQuery(select);
return rows;
catch (SQLException e)
System.out.println(e.getMessage());
return null;
private static Code getCode (ResultSet codes)
try
String name = codes.getString("student-name");
String scode = codes.getString("student-code");
String ic = codes.getString ("student-ic");
String add = codes.getString ("student-address");
String phone = codes.getString ("student-phone");
return new Code (name,scode,ic,add,phone);
catch (SQLException e)
System.out.println(e.getMessage());
return null;
private static class Code
public String name ;
public String scode ;
public String ic ;
public String add;
public String phone;
public Code (String name, String scode, String ic,String add,String phone)
this.name = name;
this.scode = scode;
this.ic = ic;
this.add = add;
this.phone = phone;
}But after I have compiled the coding above, the following error existed.
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
at testing3.getCode(testing3.java:137)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
at testing3.jButton1ActionPerformed(testing3.java:71)
at testing3.access$000(testing3.java:17)
at testing3$1.actionPerformed(testing3.java:45)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at testing3.getCode(testing3.java:137)
at testing3.jButton1ActionPerformed(testing3.java:71)
at testing3.access$000(testing3.java:17)
at testing3$1.actionPerformed(testing3.java:45)
My questions here are:
1) Will my idea above work?
2) Is it correct of my query statement that send to MS Access database?
Can anyone help me?
Thanks in advance,
ning.you may try this:
String select = "SELECT * FROM your_table_name WHERE your_column_name = '" + bbb + "'";or another approach using PreparedStatement:
String select = "SELECT * FROM your_table_name WHERE your_column_name = ?";
PreparedStatement ps = con.prepareStatement(select);
ps.setString(1, "bbb");
ResultSet rs = ps.executeQuery();hth. -
Data type structure while picking data from MS Access database
Dear All,
I have to start on new interface in which data from MS Access database will be updated in the z-table in SAP. Is there any blog available which gives step by step process for MS Access-XI-RFC interface. Or please guide me on what should be the structure of the Data Type for picking the data from the MS Access database.
Regards,
NJHi Nishu,
Sender side the structure is as follows
db_sen_dt
..... emp_row
.......... f1
.......... f2
Structure is complex then check this blog
/people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes
JDBC to RFC Scenario, but it is synchronous
SYNCHRONOUS SOAP TO JDBC - END TO END WALKTHROUGH
Also check this link
Regards
Ramesh -
base /open SQL Statement etc) the first time i defined the system everything was fine but when i changed the Database (using M.S.Access) the " open SQL Statement" it would show the tables but not thier columns ,I"m using win98 sec edition / Teststand 1.0.1i need to pass data from an Access database to Teststand by using the built in Data step types(open database /open SQL Statement etc) the first time i defined the system everything was fine but when i changed the Database (using M.S.Access) the " open SQL Statement" it would show the tables but not thier columns ,I"m using win98 sec edition / Teststand 1.0.1
When I tried the same thing on another cmputer the same thing
happend
appreiciate u"r helpbase /open SQL Statement etc) the first time i defined the system everything was fine but when i changed the Database (using M.S.Access) the " open SQL Statement" it would show the tables but not thier columns ,I"m using win98 sec edition / Teststand 1.0.1Hello Kitty -
Certainly it is unusual that you can still see the tables available in your MS Access database but cannot see the columns? I am assuming you are configuring an Open Statement step and are trying to use the ring-control to select columns from your table?
Can you tell me more about the changes you made to your file when you 'changed' it with MS Access? What version of Access are you using? What happens if you try and manually type in an 'Open Statement Dialog's SQL string such as...
"SELECT UUT_RESULT.TEST_SOCKET_INDEX, UUT_RESULT.UUT_STATUS, UUT_RESULT.START_DATE_TIME FROM UUT_RESULT"
Is it able to find the columns even if it can't display them? I am worried that maybe you are using a version of MS Access that is too new for the version of TestSt
and you are running. Has anything else changed aside from the file you are editing?
Regards,
-Elaine R.
National Instruments
http://www.ni.com/ask -
How to get new and updated data into LO Excel in Xcelsius
Dear Experts,
I have created dashboard on top of webi report by using Live-Office connection. Latest data of webi report is imported into excel and mapped data with components and generated SWF file and exported into server.
To day my webi report has latest instance with new and updated data. But until unless by clicking "Refresh All Objects" i am not getting updated data into excel.
When i am trying to open dashboard in BI Launch Pad/CMC it is showing data whatever exist in excel(i.e yesterday data). But here we need to show data of latest instance of webi report.(i.e New and updated data as of now).
I have selected option "Latest instance: From latest instance scheduled by" in "refresh options".
My Question & Doubts:
1) Is it mandatory to open dashboard every day and need to click on "Refresh All Objects" to get updated data into excel or dashboard.
2) Is there any option to automate this process.
Regards,
PRK.Hi,
Schedule the webi report to get the latest data from the source. To answer your query no is doesn't require to open the dashboard every time to refresh the excel to get the latest data.
Please use the Refresh Before Components are Loaded: Select this option to refresh the data each time the model loads and to use that data as the initial data for the model (using a Reset Button component, it will reset the data to the values from the last time the model was loaded).
You are using the Live Office so here automatic refresh is not possible without touch the swf file, you need to use the refresh but to get the latest data. If you are using QAAWS, Web Service & XML then automatic refresh is possible.
For more information please check the below document for in-depth idea on the design pattern.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b02e31fb-3568-2e10-e78f-92412c3c0a96?overridelayout=t…
Kindly revert for more clarification!!!
--SumanT -
How to add attachment and export data into MS Access
Let's say that I use PDF file to capture data from users and import the data to MS Access database (via XML). I wonder if there is a way to let user add attachments in Acrobat Reader and when the data is exported, the attachments are kept separately in a new column in MS Access.
If you are trying to do this with script from within the PDF ...I do not think so. You woudl not be able to get the stream of bits that make up the attachment to be able to write it to the DB.
Paul
Maybe you are looking for
-
Using the transaction launcher to call a BOR method to display a PDF
Hello gurus, I have created a PDF icon and an onclick action to open a pdf, that displays on every row of an assignment block in the actions column, but I do not know the technical process to determine how to get a PDF from the IXOS system from the l
-
How do I connect wireless keyboard to Tv
How do I connect wireless keyboard to Apple TV
-
I have updated my iphone 5 with IOS7. Now there is an update 7.0.2 on my cell and the size of update file is showing around 21.0 MB. I tried to update it ITunes but it seems it is downloading the entire IOS. Is there any separate update for the same
-
Added fields does not show up in the RSA6
Hello. Problem 1: I am enhancing 0bbp_td_sc_1. I added a field to the structure, but it does not show up in the rsa6. ( I double clicked on the extractor name). If I go to the extractor structure (BBP_SC_BW_GET_TD_STRUC), I am able to see the append
-
Hello, we have new General Ledger (ECC 5.0) for two years. During this year we decided to use paralel ledger for IAS / IFRS purposes from 1.1.2007 backwards. We have activated the additional parallel ledger according to SAP documentation. Now we need