Update Jtable from access database
as the title suggests help me guys... till now i have a database and some contents in it.. when the application starts the table is filled with contents of the database.. now whenever i add or remove a row in the databse i want to show it in the table... i have a Vector called dbData with the present contents of the database.. i want to update jtable with contents of dbData.... how to do it??
the best things i can see to do is
JTable table = new Jtable(.....); // this was ur table before;
deleteRow(table); // you deleted the row
// now you have a vector containing all the data for the rows;
// but you need a vector containing the columns for the rows too
//so now you do
table = new JTable(dbData,columnnames);
repaint();dbData must be a vector of vectors;
dbData.elementAt(1) return a vector with all the data for row one
so dbData.elementAt(1).elementAt(1) will be the data for row 1 column 1
// dbData will be the data still remaining in the table
or instead of the above you could use a nested for loop and set each element one at a time
Object temp;
int numberofRows = dbData.elementCount();
int numberofColumns = db.elementAt(0).elementCount();
for(int row = 0; row < numberofColumns;row++)
for( int column = 0; column < numberofRows; column++)
temp = dbData.elementAt(row).elementAt(column);
table.setValueAt(temp,row,column);
}
Similar Messages
-
Upload data from Access Database to Oracle Database In oracle 8i
hi everybody
i am trying upload data from Access database to Oracle Database
i have TT(F1,F2,F3) table in Access Databsse
and emp(ename,ecode,sal) in oracle Database
db_ac is my datasource name
when i connect to Access Database thru this command this show following error
SQL> connect a/a@odbc:db_ac;
ORA-00022: invalid session id; access denied
ORA-00022: invalid session id; access denied
ORA-00022: invalid session id; access denied
Error accessing PRODUCT_USER_PROFILE
Warning: Product user profile information not loaded!
You may need to run PUPBLD.SQL as SYSTEM
Server not available or version too low for this feature
ORA-00022: invalid session id; access denied
Connected.
when i am trying copy data as this command it show error and data not copied.
SQL> COPY FROM A/A@ODBC:DB_AC TO test/test@ora INSERT EMP USING SELECT F1,F2,F3 FROM TT;
Array fetch/bind size is 15. (arraysize is 15)
Will commit when done. (copycommit is 0)
Maximum long size is 80. (long is 80)
ORA-00022: invalid session id; access denied
ERROR:
OCA-00022: general OCA error
can help me .
with thanxHi there,<br>
<br>
Please kindly use instead the Database Forum at:-<br>
General Database Discussions<br>
<br>
... to place your question as this is for the Oracle Portal product Export / Import functionality.<br>
<br>
<br>
Kind regards,<br>
Pedro. -
Giving input to jtable from a database in runtime
friends
previously i have posted an query asking how to intilize the row size of jtable in run time for which i got good rewsponce to direct me to an page in sun/components,i read the jtable page in specifie link provided in sun,but i could not figure out how to give input to jtable from a database on runtime.In that page they have used by giving input in an array and then displaying it, by that they set the no of rows in the table ,but i want to set the row size based on number of records fetched from the oracle database.kindly guide me
ArjunWhat you need is to develop a table model which uses a database as the data source.
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#data -
Data access from Access Database
I want collect some data from access, I have created a frame with swing componet, now when I am searching data with some variable from Access database , it is not comming, but in simple case all data are comming in differnt places in my frame.
The string which I used is
st.executeQuery("Select * from student where cid = '+st1+'"
where st1 is avariable collected some data from the frame, it is tested ok.
now i never did practice with access, please if there is any wrong .Could you include more code please? The single statement you have provided seems fine, but we're not psychic.
-
Hi,
I am new to Swing and I was wondering if anyone could help me with the following problem.
I have a tablemodel which extends AbstractTableModel which is used to create my JTable. The data to display in the table is got from a SELECT statement from the database, this works fine.
The problem is that I have a rollback button which rollbacks any data changed in the database. I then have to do another SELECT statement from the database to populate the table again.
Is there anyway to do this other than calling the Select function?
Any Help or Ideas would be greatly appreciated.
Thanks in advance
FrankThanks for replying ceccs,
I did try this by creating a backup vector of the database table. But everytime I changed the data in the Jtable this changed the backup one.
I haven't got a clue as to why this is happening -
Not getting the records from Access database
Hi All,
Iam creating a universe based on Access database. I am able to view the data from all the tables except one table. When i try to view the data there is one error message "Syntax error in from clause, State: 37000". Everything is ok at database side. What does this error means?
Please help me on this.
Thanks.Hi BOCP,
Thanks for your reply. I have resolved my issue. Actually my issue was, I have a table "Date" in universe which was created in Access database, when i tried to view the Date Table values in Universe i was getting that Syntax error in From clause message. I came to know that Date is a keyword or predefined table in WebI & it wont accept that word as a user defined Table. So i renamed that table in Access and Universe. Now my issue was solved.
Thanks,
Swati. -
Trying to display results from access database query on a JSP
Seem to be having real difficulty with this one, i keep getting a null pointer exception :(. Wondered if anyone could point me to any examples of displaying the results on jsp. The database is connected, as i can display the query on netbeans, but just not on a jsp.
I think it would be good if we had a section in these forums for pre-canned answers to the same questions that come up again and again. It would save time.
Here is a rough outline for using JSP:
* Read a JSP book.
* The JSP page (View in MVC) should get all the data it needs to display from a useBean and/or request.getAttribute().
* The JSP page should not have any business logic. Its purpose is to display data only (and have some submit buttons such as 'update').
You can do some basic client side validation using javascript if you want. Because there is no business logic in it, you can easily debug
your code in the servlet or business logic. You can't set breakpoints in JSP and examine data easily.
* When you click the submit button, all data from <input type="text" tags, etc is put into request scope via name/value pairs.
* Submit the JSP page <form tag to a servlet (Control in MVC).
* The servlet reads the name/value pairs of data from the JSP page via request.getParameter()
* The servlet should then instansiate a business object (Model in MVC), passing the data it got from the page to the business logic.
Example: ProcessPage processPage();
if(request.getParameter("updateButtonClicked"))
processPage.updateData(data from the jsp page)
* The business logic should instansiate a separate database object (DAO) to get data to/from the database. Business logic should not have sql in it.
Business logic should not generate html. Business logic should not have request objects in it.
* The business logic should return data to the servlet that in turn will put it in request scope via request.setAttribute() so the JSP page can draw itself.
* The servlet should then call up the approprate JSP page. -
Transferring a lot of data from Access Database to Labview
I need to transfer 500000 -> 1000000 values in a Access database table to Labview. The values are selected using a query which is very fast if run in Access itself, but from Labview it's very slow. Obviously the connection between Labview and Access is the slow point.
Im using the NI Database connectivity toolset and a UDL file defines the connection. Microsoft Jet 4.0 OLE DB Provider is used.
To be honest i dont know what that really means, just that it normally works but now its stupidly slow for so much data.
Thanks for any help.
RobOne of my continual gripes with the DBCT is it's poor behavior on large data sets. See NI's response here:
http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/862567530005f0a186256a33006b917a?OpenDocument
Actually, I wouldn't find it nearly so annoying but for the part that says "In most database books you are told not to return large recordsets...". I prefer the freedom to make a mess of things myself, thanks.
On the plus side, the VI referenced in the article is fairly efficient, you just have to deal with type conversion once things have been moved into LabVIEW. -
Hi,
I created a PDF form where I have open, next, previous buttons, and I'm able to connect to the access database, and it's working fine. Now, I want to be able to search by last name from the access database, and retrieve the results in a dropdown field, and then once i select the records in the drop downlist, i want to press a button to display the record. I have multiple records with the same last name. Please help, I searched the internet for hours, and can't find something similar. Your help is appreciated, and sample code is appreciated.<%
int count = 0;
while (rs1.next()){ %>
<%if (count ==0)
{%>
<option value="<%=inputorthodon%>" selected >
<%=rs1.getString("ortho_name")%></option>
<%}
else{%>
<option value="<%=inputorthodon%>">
<%=rs1.getString("ortho_name")%></option>
<%}
++count;} %>
</select>
U may have to format this a bit. The idea is to use a count variable to put "selected" in only the first OPTION. After that, we don't have to.
Hope this helps. -
How to read/write from Access database
Hi everybody
I need a little help for doing what I wrote in the topic!
I use LabVIEW 6i student edition, do Ireally need to install the Database
connectivity toolkit?Hi Vicio,
There are a couple of different methods to communicate with Access in LabVIEW, and some are more difficult than others. You can use ActiveX Automation to open Microsoft Access and control many aspects of the Access Application. For actual database manipulation however, the Access automation classes rely upon the Microsoft DAO (Data Access Object) and/or ADO (ActiveX Data Object) classes. These classes can be used independently or through the Access automation classes to read and write data into an Access database. These classes can be difficult to use and may require a fair amount of SQL knowledge to accomplish a complicated task. Attached is a very simple example of how you can use DAO from the Access automation classes to read an Access table.
For more information about the Microsoft Access automation classes, DAO or ADO classes refer to the Microsoft website and Developer Network:
MSDN
It is also possible to use Dynamic Data Exchange (DDE) communication between LabVIEW and Access. DDE is a Microsoft technology that preceded COM and ActiveX. DDE is NOT recommended as it is considered by most to be obsolete. However, examples still ship with LabVIEW that demonstrate how to communicate with MS Access using DDE. The examples are located in ..\LabVIEW\examples\comm\access.llb
Note: The LabVIEW Database Connectivity Toolset is the preferred method of database communication with LabVIEW. The LabVIEW Database Connectivity Toolset offers many powerful tools and extended capabilites for quickly accessing databases. The LabVIEW Database Connectivity Toolset offers connectivity to most popular databases through Microsoft ADO technology, complete SQL Functionality, and the ability to save records in XML format. It provides both easy-to-use and advanced functions to allow common database operations as well as detailed database accessibility. The LabVIEW Database Connectivity Toolset is sold separately or in the LabVIEW Enterprise Connectivity Toolset along with the LabVIEW Statistical Process Toolkit and the LabVIEW Internet Developers Toolkit.
Sincerely,
Feroz
National Instruments
Attachments:
Access_ActiveX.vi 43 KB -
UPDATE VALUE IN ACCESS DATABASE-CONNECTIVITY DATABASE?
Hi to all labviewers,
I'm trying to update some values in my access database with sql and labview connectivity toolset but i got
an error, what is the problem whit my code?
note: when i try to update one colum it's work fine.
regard's
eyal.
Attachments:
UPDATE_ACCESS.JPG 79 KBHi,
I'm not sure if you can use comma's to seperate criteria. Thy this:
WHERE criteriuma='something' AND criteriumb='something else'
Regards,
Wiebe.
"Discussion Forums" <[email protected]> wrote in message news:[email protected]..
Hi to all labviewers,
I'm trying to update some values in my access database with sql and labview connectivity toolset but i got
an error, what is the problem whit my code?
note: when i try to update one colum it's work fine.
regard's
eyal.
UPDATE_ACCESS.JPG:
http://forums.ni.com/attachments/ni/170/152737/1/UPDATE_ACCESS.JPG -
Menu flyouts from Access database?
Greetings,
I'm a midlevel DW programmer, and low level CF programmer,
and very low Flash programmer. I have a client that wants to have
about 5 vertical menu buttons. Each button needs to have a flyout
submenu that could have 20 or so selections, and each of those
could have 20 or so flyouts.
I'd like to know if there is an preexisting menu program or
extension out there that will allow me to put all of the
menu/submenu selections into an Access database, and have the menu
pull data from there?
Many thanks,
Stephen
Tallahassee, FLyea, lol
A list of there available products.
http://www.interaktonline.com/Products/
regards
Kenny
"Murray *ACE*" <[email protected]> wrote
in message
news:efdu8g$s3b$[email protected]..
> Still available?
>
> --
> Murray --- ICQ 71997575
> Adobe Community Expert
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
>
http://www.dreamweavermx-templates.com
- Template Triage!
>
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
>
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
>
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
> ==================
>
>
> "twocans" <[email protected]> wrote in message
> news:efdu5j$s11$[email protected]..
>>
>>
http://www.interaktonline.com/Products/Dreamweaver-Extensions/MXCSSMenus/Skins/
>>
>>
>> regards
>>
>> kenny
>>
>>
>> "sbsmithfl" <[email protected]>
wrote in message
>> news:efdtlo$rcr$[email protected]..
>>> Greetings,
>>> I'm a midlevel DW programmer, and low level CF
programmer, and very
>>> low
>>> Flash programmer. I have a client that wants to
have about 5 vertical
>>> menu
>>> buttons. Each button needs to have a flyout
submenu that could have 20
>>> or so
>>> selections, and each of those could have 20 or
so flyouts.
>>>
>>> I'd like to know if there is an preexisting menu
program or extension
>>> out
>>> there that will allow me to put all of the
menu/submenu selections into
>>> an
>>> Access database, and have the menu pull data
from there?
>>>
>>> Many thanks,
>>> Stephen
>>> Tallahassee, FL
>>>
>>
>>
>
> -
hi all
i am having trouble updating a jtable from a list.
the table is declared as follows
//TableTracks.java
String[] columnNames = {"Track Number",
"Mute",
"File/Track Name",
"Number of Loops",
Object[][] data = {
{"1", "0", "", "1" , },
{"2", "0", "", "1" , },
{"3", "0", "", "1" , },
{"4", "0", "", "1" , },
{"5", "0", "", "1" , },
{"6", "0", "", "1" , },
{"7", "0", "", "1" , },
{"8", "0", "", "1" , },
final JTable table = new JTable(data, columnNames);I would like to select a value in a List by using the arrow keys, then when pressing enter key the selected List value appears in a cell in the table.
The list works fine for me, i get a Listvalue string from the following method
//Part of FileList.java
//tableTracks class constructor
TableTracks tableTrack = new TableTracks();
public void keyReleased(KeyEvent e) {
switch(e.getKeyCode()) {
case KeyEvent.VK_ENTER:
value = jlst.getSelectedValue().toString();;
if (value.endsWith(".wav"))
iNameLen = value.length();
value = value.substring(iEntryType,iNameLen);
System.out.println("sending..... " + value);
tableTrack.insertValue(value);
break;
}So far so good! in the above i call the insertValue method and below is that method
//TableTracks.java
void insertValue(String file)
System.out.println("insertVal: " + file);
table.setValueAt(file, 3, 3 );
}in both of the system.out.println statements in the above 2 methods, the correct value is displayed. But it simply will not display the vlaue in the table.
Before i added the List option to my program, i had it working by allowing the user to select a file name using a FileChooser. With this method, the table.setValue worked fine. But now, it will not.
Any help or suggestions would be very greatly appreciated.
cheers
RCYou probably defined the "table" variable twice. Once as a class variable and once as a local variable and your "insertValue" method is referring to the wrong variable and therefore updating the wrong table.
-
Get the list of table's last Inserted/Updated date from a database
Hi All,
Good afternoon!
Please help me to find the last inserted/updated date from different tables in a database.
Consider I have a database called testDB, which contains 20 tables. Most of these tables will get data inserted/updated daily. But sometimes it may not happen due to some issues . We will not be knowing about this issue until we check in each table
manually. Now, somebody should be daily checking for the issues in this db. So, we have decided to make an alert mail to send this informations to us.
We need to check whether any of the table's in TetsDB has got inserted/updated data in one day difference.
I have tried this..
SELECT OBJECT_NAME(OBJECT_ID) AS Object_, last_user_update,*
FROM sys.dm_db_index_usage_stats
WHERE database_id = DB_ID( 'TestDB')
Thanks,
JulieThe solution depends on the version and edition of your SQL Server.
If you use SQL Server 2000 or SQL Server 2005, please visit these links:
How do I audit changes to SQL Server data?
Table Auditing with SQL Server 2000
If your SQL Server 2008 or above (only on the Enterprise edition), please have a look at this link:
Change Data Capture
If your SQL Server 2008 or above (all editions),
you can use Change Tracking, but Change tracking captures the fact that rows in a table were changed, but does not capture the data that was changed.
more info:
Comparing Change Data Capture and Change Tracking
Saeid Hasani [sqldevelop]
HI,
I've read about change tracking change data capturing now.
We need to track the data daily and we need to know whether any modification happens in those tables.
Will it make any performance issue if I enable change data capturing on multiple tables.. lets say 20+ tables.? -
Link dropdown choice to multiple text fields from access database
Is there anyway to link the choice of a dropdown field so it populates other text fields?
Example:
I have created a Data Connection from a MS Access Database for a drop down list which is CompanyName. When I choose the company name I would like it to populate First Name, Last Name, Email, Adress, etc. Does this require a significant amount of code to do...and if so does anyone have a good book suggestion to learn the code for something like this?
Any help in solving this problem is greatly appreciate. I have searched everywhere and found no conclusive answer. Or maybe I am just searching in the wrong place? Thanks for your help.You will have to make another data connection and create a SQL call to the DB that will incorporate the selection made in the DDList. This will involve code. There is a sample wriiten by Stefan Cameron at this location:
http://forms.stefcameron.com/2006/09/29/selecting-specific-database-records/
Paul
Maybe you are looking for
-
OSS note 506603 What is it And where can I get it?
Hello, I am trying to create my form with a SAP Table wizard connection, when I try to use the Table wizard I got the error: "No such interface supported". I can see in a lot of comments the solution is on OSS note 506603. I was trying to find this p
-
Dynamic Standard text in SAPscript
Hi, Can we use dynamica standard text in SAP script? The standard text name is supplied by a external field. The standard text contains a address. I want to change address based on text name. Thanks. Shreyas Help will be awarded.
-
Some album art not displaying in
I have the latest firmware release (.60.0). After either syncing via an app or simply dragging and dropping via Media Explorer, some album art does not display properly in my ZVM in the Album art view nor when the song is played. The method I used is
-
Success with Microsoft Streets & Trips 2007 w/GPS
Has anyone had success using this app with their macbook/pro? The gps is usb, and before I make the plunge, I want to know how well this is working with the mac/windows combo. TIA...
-
FormCalc - What is the "exponent" operator?
Hi, I want to make a simple calculation in my form that uses an exponent and I can't find anywhere what is the FormCalc operator for an exponent. I've tried ^ (e.g. (1+i)^n) and Math.pow((1+i),n) but neither one seems to work. Can anyone help please?