Getting Data From MySQL Database using Dreamweaver CS4 Built In Functions

Hi,
I am really in need of some help if you don't mind.
I basically have a website with user regsitration system etc and so on.
I basically connected to my Data Base in Dreamweaver CS4 and now want to use the tools in Dremweaver CS4 to display Data from database.
Problem is i see the tools but not really sure how i use them. I see on Data bar all the tools to view, update delete records etc.
I basically created a page where i want to display all the records in the DB. I done this using dynamic data selecting what fields to display etc and 15 records per page.
When i view the page in localhost thou it is only showing 1 record althou i have like 5 users in my test db.
So if anyone can really tell me how i go about displaying data from db that be great. When i learn how to do that i probably will understand and learn how to update records etc.
Thanks

To display all records, you need to apply a repeat region to the paragraph, div, or table row that contains the dynamic text objects for the database results. You might also find it helpful to follow the dynamic application tutorial in the Adobe Developer Connection.

Similar Messages

  • How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    If the data is on a remote server (for example, PHP running on a web server, talking to a MySQL server) then you do this in an AIR application the same way you would do it with any Flex application (or ajax application, if you're building your AIR app in HTML/JS).
    That's a broad answer, but in fact there are lots of ways to communicate between Flex and PHP. The most common and best in most cases is to use AMFPHP (http://amfphp.org/) or the new ZEND AMF support in the Zend Framework.
    This page is a good starting point for learning about Flex and PHP communication:
    http://www.adobe.com/devnet/flex/flex_php.html
    Also, in Flash Builder 4 they've added a lot of remote-data-connection functionality, including a lot that's designed for PHP. Take a look at the Flash Builder 4 public beta for more on that: http://labs.adobe.com/technologies/flashbuilder4/

  • How can i get data from another database SQL Server use database link from

    I have a database link from Oracle connect to SQL Server database with user cdit connect default database NorthWind.How can I get data from another database(this database in this SQL Server use this database link)?

    hi,
    u should see following documentation:
    Oracle9i Heterogeneous Connectivity Administrator's Guide
    Release 1 (9.0.1)
    Part Number A88789_01
    in it u just go to chapter no. 4 (using the gateway),,u'll find ur answer there.
    regards
    umar

  • Single query to get data from different databases

    i need to capture certain fields from certain tables in database 1 and certain fields from certain tables in database 2 into one file using a single SQL statement.
    i tried searching on the net
    i found that dblinks can help
    but iam not sure if ill be able to create dblinks in my situation which is:
    i need to get data from oracle to be copied to mysql
    this is not a replication acitivity, but i need certain fields from one database and certain from the other
    so what iwas thinking is, if i use an sql query to get all the fields (i need around 40) from the different oracle databases and create a singlefile with one insert per select, i can then read that file into mysql
    instead of creating multiple sql queries for each table and creating separate files and eventually separate tables in mysql.
    can anyone help me here?
    or maybe suggest another approach.
    thanks

    Hi,
    I think dblink is the only option available to get data from different databases. It will work for your case too.
    CREATE DATABASE LINK db_link CONNECT TO user_name IDENTIFIED BY  password USING 'instance_name'you must have the system privilege 'create database link' to create db links. This way you can get the required data and put it in a table in oracle. But i dont know how to put this data from oracle table to Mysql.
    HTH
    Muneer

  • Getting data from MySQL

    I'm a web developer that is familiar with PHP and MySQL. I
    just started working with a guy who has created a site in Flash for
    a client, and I've created the backend in PHP. It was understood
    that all I'd have to do would be to PUT information into the
    database and he'd pull it out on the site. Things have changed and
    I've been asked to pull the data down for him.
    I've Googled to find out that it's possible to get data from
    MySQL into Flash via a textfile formated as such: 'myVar=[data]'. I
    don't know the specifics, but I can figure that all out. However, I
    have two particular questions regarding the data:
    1.) How does Flash handle HTML formatting? The CMS I've
    written allows an administrator to input plain HTML and I store
    that in the database; how will that translate into Flash? Does
    Flash have an HTML parser? I've been having trouble filtering
    through searches on Google about using HTML to put Flash on a page
    instead of Flash parsing HTML. I read on another forum that Flash
    has an HTML 1.0 parser, but the post was dated August 2003.
    2.) I've also been storing images as BLOBs in MySQL. How do
    I go about pulling these images out? Of the tutorials I've found on
    Google, all I can hit with my searches are scenarios in which
    people store image
    paths in the database, and output them in the same textfile,
    'myImage=/images/image.jpg' etc.
    [url=http://forums.devarticles.com/web-development-40/flash-mysql-longblobs-9659.html]Thi s
    unanswered forum post off-site[/url], is similar to what I'm trying
    to do, but I'd need to display many images in a flash movie and I
    don't think passing them via src would work.
    I'm not necessarily asking for complete solutions for these
    problems, I just need to be pointed in the correct direction, maybe
    a function or a document I'm missing.

    quote:
    Originally posted by:
    MotionMaker
    1. Flash TextFields can handle a limited amount of HTML:
    Supported
    HTML tags. The .html property is enables HTML rendering and
    .htmlText property for asssigning the HTML.
    Those tags would probably be fine. We're not trying to do
    anything fancy.
    quote:
    2. Your PHP scripts cannot send back HTML. They can send back
    data either in URL Encoded format or XML. That means your script is
    only echoing data. The HTML can be stored in data such as a URL
    variable or in CDATA node of XML.
    Ex for URLVars: echo theHtml=<p>This
    is<b>bold</b></p>&var2=1234&var3=true;
    Ok, that's what I thought.
    quote:
    3. You will need your PHP script to create a temporary jpg
    file on the server and send to Flash the name of the file. Then you
    use either MovieClip.loadMovie or MovieClipLoader to fetch the jpg
    on the Flash side. There should be links on the web for the PHP
    part handling the filenaming and the garbage collection.
    Uhg, that's what I also thought, and was afraid of. You told
    me everything I need to know I think. Thank you.

  • How to get data from MySQL into Analysis Services Tabular Model

    Hi,
    I have a problem with Analysis Services Tabular Model and MySQL ... I have to use several MySQL databases as a source of Tabuar Model ..
    Is there any way to get connection working from Tabular Model to retrieve data from MySQL database. I have a situation that in MySQL server there is several databases with same schema, one for each customer. I have planned to join these customer databases
    to one Tabular Model, create roles and users for each customer to query their data.
    What do I have to do to get this working ?
    Pasi

    Hi ,
      In Tabular model out of the box there is no direct connectors available for MySQL. Please see the list of supported Data Sources
    http://msdn.microsoft.com/en-us/library/gg492165.aspx
    But i think if you can establish a ODBC connectivity with data source to MYSQL , you can use the ODBC connection to retrieve the data from MySQL. Please try this and post the results here if it is possible or not.
    Best Regards Sorna

  • Populate Livecycle PDF from mySQL database using PHP

    I'm trying to set up a database of loan agreements, where users will submit a form through Acrobat and their information will be stored in a mySQL database. Later, they can go back and download the PDF, which will be repopulated with their data in the mySQL db.
    I made the form in Livecycle Designer and submit the information through HTTP POST. I can easily get the information from the form into the database...my only problem is getting that information back out into the PDF.
    What would allow me to write back to the PDF, preferably using PHP? What kind of syntax would that require?
    Thanks!

    I have a vital form that clients fill out, which is passed to many people in the company along the workflow. The form is a Planner and we have in the following PDF, Word Doc..
    Well before, the Planner.pdf was originally created in Word, since most people have access to Word.. but evolved to a PDF form created from the Word Doc via Adobe LiveCycle Designer 8.0 w/ User Rights enabled so that the form could be filled out and saved using Adobe Reader.. which was a step better than Word.. being that it is free. But this needed to be easier and more to the point b/c some clients don't particularly like installing the latest version of Reader, even if you provide them the link. Nor do they like saving the form, filling the form, and attaching the form to send back.
    My goal is to have the client fill an HTML version of the form, submit and be done with it, but everyone in the workflow be able to easily receive the filled Planner as a PDF form.
    So some months ago I ran into this post Chris Trip, "Populate Livecycle PDF from mySQL database using PHP" #8, 22 Sep 2007 4:37 pm
    which uses the command line Win32 pdftk.exe to merge an FDF file into an existing PDF on the remote server, and serve this to whoever.
    My problem was with shared hosting and having the ability to use the Win32 pdftk.exe along with PHP which is predominantly used on Linux boxes. And we used a Linux box.
    so i created the following unorthodox method, which a client fills the HTML version of the Planner, all field values are INSERTED into a table in MySQL DB, I and all filled planners that have been filled by clients to date can be viewed from a repository page where an XML file is served up of the corresponding client, but someone would have to have Acrobat Professional, to import the form data from the XML file into a blank form.. altoughh this is simple for me.. I have the PHP file already created so that when a Planner is filled and client submits. >> the an email is sent to me with a table row from the repository of the client name, #, email, and a link to d-load the XML file,
    But I also have the PHP files created so that the Planner can be sent to by email to various people in the workflow with certain fileds ommitted they they do not need to see, but instead of the XML file beiong served up i need the filled PDF Planner to be served.
    I can do this locally with ease on a testing server, but I am currently trying to use another host that uses cross-platform compatibility so i can use PHP and the pdftk.exe to achieve this, as that is why I am having to serve up an XML file b/c we use a Linux server for our website, and cant execute the exe.
    Now that I am testing the other server (cross-platform host), just to use them to do the PDF handling (and it's only $5 per month) I am having problems with getting READ, WRITE, EXECUTE permissions..
    Si guess a good question to ask is can PHP do the same procedure as the pdftk.exe, and i can eleminate it.
    or how in the heck can i get this data from the DB into a blank PDF form, like i have described??
    here are some link to reference
    Populating a LiveCycle PDF with PHP and MySQL
    http://www.andrewheiss.com/Tutorials?page=LiveCycle_PDFs_and_MySQL
    HTML form that passed data into a PDF
    http://www.mactech.com/articles/mactech/Vol.20/20.11/FillOnlinePDFFormsUsingHTML/index.htm l
    and an example
    http://accesspdf.com/html_pdf_form/

  • How can i  get data from anather database system  ????????

    Hi every body..
    I 've a problem .....
    I've an old program work on "DOS" and it's content database which content all Data that i need for that program
    The data file extension with ".FD" , ".VW" , ".LSS" & "SLP"
    I want to kow:-
    1) what is that database system
    2)What program could open or can get data from that database tables.
    3)can i do that with oracle...
    please describe every thing in details...
    ... Please replay quickly... urgently
    ...waiting your answer....

    You're probably better off consulting the documentation for the DOS program you're trying to deal with than hoping someone here will be able to guess what program you're using, identify the structure of the files, and tell you how to extract the data into something Oracle can import.
    Justin

  • Best way To get data from another application using NDDE lbrary

    My vb.net application gets data from another application using NDDE Library. I got stocks prices (open,high,low,close,volume,change......(about 15 records for each stock)) (about 200 stocks) . I don't know if there is a problem in my code.
    This is my code:
    l : is the list of stocks.
    This Sub connects to server and requests the data :
    Public Shared Sub GetQuotes()
    Try
    client1 = New DdeClient(server, topic)
    client1.Connect()
    For i As Integer = 0 To l.Count - 1
    client1.StartAdvise("QO." & l(i).t & ".TAD$last", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$open", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$high", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$low", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$pclose", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$volume", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$date", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$time", 1, True, 60000)
    Next
    Catch ex As Exception
    MsgBox(ex.Message)
    End Try
    End Sub
    and then I get the data from Client_advise sub (called each time a value changed )and fill the list. What I know is that client advise gets only one record for single stock each time is called..
    Example: for stock AAPL. 1st time enters client_Advise I get open price for AAPL, 2nd time I get high price for AAPL,3rd time I get low price..... and I update the value in the List (l)
    This the client_Advise Sub:
    Private Shared Sub client1_Advise(ByVal sender As Object, ByVal e As NDde.Client.DdeAdviseEventArgs) Handles client1.Advise
    For q As Integer = 0 To l.Count - 1
    If l(q).t = w(1) Then
    Dim item() As String = e.Item.Split("$")
    If l(q).Open = "#" Then
    l(q).Open = "0"
    End If
    If l(q).hi = "#" Then
    l(q).hi = "0"
    End If
    If l(q).lo = "#" Then
    l(q).lo = "0"
    End If
    If l(q).Close = "" Or l(q).Close = "#" Then
    l(q).Close = "0"
    End If
    If l(q).pclose = "#" Then
    l(q).pclose = "0"
    End If
    If item(1) = "open" Then
    l(q).Open = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "last" Then
    l(q).Close = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "high" Then
    l(q).hi = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "volume" Then
    l(q).Volume = Val(e.Text)
    ElseIf item(1) = "low" Then
    l(q).lo = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "pclose" Then
    l(q).pclose = Format(Val(e.Text), "0.00")
    If l(q).pclose <> "" And l(q).pclose <> "#" And l(q).Close <> "" And l(q).Close <> "#" Then
    l(q).c = Format(l(q).Close - l(q).pclose, "0.00")
    l(q).cp = Format(((l(q).Close - l(q).pclose) / l(q).pclose) * 100, "0.00")
    End If
    l(q).flag1 = 2
    ElseIf item(1) = "date" Then
    l(q).Date1 = e.Text
    ElseIf item(1) = "time" Then
    l(q).Time = e.Text
    End If
    Exit For
    End If
    Next
    End Sub
    Am I doing something wrong which inreases CPU usage to 80 or 90 % ?
    Thanks in advance.

    Hi MikeHammadi,
    According to your description, you'd like to get data from another app using NDDE library.
    When using the NDDE library, the CPU usage is high. As the NDDE library is third-party library, it is not supported here. I suggest you checking if the problem is caused by the NDDE library.
    If you'd like to get data from another app. I suggest you could save the data in the dataBase, and then read it in another application if necessary.
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Get data from two databases?

    Hello all,
    Do anyone know if it's posible to get data from two databases while I'm running SBO in one of them? I need this because our client wants to be able to print reports with all the information stored in both companies. I searched this forum trying to find if this is possible but I did't find any information about this.
    Can someone help me?
    Thanks and regards,
    Mariana Mazzero

    Hi Mariana,
    What you can do is use two company objects to retrieve the data. As far as I know you're not restricted to one company connection.
    You can also just use a standard read only connection (like ADO/ODBC) to retrieve the data for the reports.
    Hope it helps,
    Adele

  • FETCH DATA FROM ORACLE DATABASE USING Web Dynpro

    I want to fetch data from ORACLE database using Web Dynpro.How can I do this?

    1) Are you sure that you get no results? It sounds like you are having name resolution issues, which would imply that you should be getting an ORA-00942 error indicating that the table doesn't exist (or that you don't have access to the table). If you are not seeing this error, I would tend to suspect an overzealous exception handler.
    2) What database account owns the table? What database account is your ASP.Net application using to connect? Assuming these two accounts are different, your application would either have to
    - Explicitly prefix the table name with the schema name
    - Have a public or private synonym that maps the table name to the fully qualified identifier schema_name.table_name
    - Issue the command ALTER SESSION SET CURRENT_SCHEMA = <<schema name>> in each session, in which case all queries in the session would use the specified schema name as the default if no schema name is prefixed.
    Justin

  • How do i get data from a structure using join?

    hi,
    what is the actual use of a structure.?
    my problem is :
    KUAGV is an existing STRUCTURE. it has got one fields each which links to MARA, AND VBKD tables. i want to fetch all related information from KUAGV, mara, vbkd . which is the better way : using joins or views or anything else? how do i
    get data from a structure using join?

    structure temporarily holds  any data passed to it dynamically throughout the runtime but doesnot store it permanently. so
    a structure cannot be included in a join.so instead of incuding structure KUAGV's field in a join 
    search the transparent table in which same field are present and  use it in join.
    A structure if created in DDIC(Data Dictionary) is a global DATA STRUCTURE which is used to group related information, for example you would group all the details of your bank account into a structure BANK_ACCOUNT that contains fields like account_Id, account_holder_name etc.
    If you create a structure in your program then it is local to your program. So you use this structure to create data holders of this DATA TYPE to hold data in your program.
    Edited by: suja thomas on Feb 11, 2008 6:24 AM
    Edited by: suja thomas on Feb 11, 2008 6:31 AM

  • Can not get data from mySql

    I prepared a GUI user connection application in NebBeans 5.5 accessing mySql database in the company server. The application run very well in desktop.
    However, when I post it to the company server web, it gets nothing from the database.
    Can any one give advice???
    Thank you in advance.
    The following is my application
    import java.util.Vector;
    import java.awt.event.*;
    import java.awt.*;
    import java.awt.event.*;
    public class UserConnection extends javax.swing.JFrame {
    //constants for database
    private final String userName = "labmanage";
    private final String password = "labmanage";
    private final String server = "jdbc:mysql://svr.corp.com/labmanage";
    private final String driver = "com.mysql.jdbc.Driver";
    private JDBCAdapter data = new JDBCAdapter(server, driver, userName, password);
    //variables
    private String user, pwd;
    private Vector<Vector<String>> userTable = new Vector<Vector<String>>();
    private Vector<String>colUserNames = new Vector<String>();
    * Creates new form UserConnection
    public UserConnection() {
    initComponents();
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
    private void initComponents() {
    userLabel = new javax.swing.JLabel();
    pwdLabel = new javax.swing.JLabel();
    userTextField = new javax.swing.JTextField();
    passwordField = new javax.swing.JPasswordField();
    submitButton = new javax.swing.JButton();
    statusLabel = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    statusTextArea = new javax.swing.JTextArea();
    changePwdButton = new javax.swing.JButton();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("User's Connection");
    setBackground(new java.awt.Color(153, 204, 255));
    setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    setFont(new java.awt.Font("aakar", 1, 12));
    userLabel.setText("User Name:");
    pwdLabel.setText("Password:");
    submitButton.setText("Submit");
    submitButton.addMouseListener(new java.awt.event.MouseAdapter() {
    public void mouseClicked(java.awt.event.MouseEvent evt) {
    submitButtonMouseClicked(evt);
    submitButton.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    submitButtonActionPerformed(evt);
    submitButton.addKeyListener(new java.awt.event.KeyAdapter() {
    public void keyTyped(java.awt.event.KeyEvent evt) {
    submitButtonKeyTyped(evt);
    statusLabel.setText("Status:");
    statusTextArea.setColumns(20);
    statusTextArea.setEditable(false);
    statusTextArea.setLineWrap(true);
    statusTextArea.setRows(3);
    statusTextArea.setText("Initial assigned password is \"dime\".");
    statusTextArea.setWrapStyleWord(true);
    jScrollPane1.setViewportView(statusTextArea);
    changePwdButton.setText("Change password");
    changePwdButton.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    changePwdButtonActionPerformed(evt);
    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(layout.createSequentialGroup()
    .addContainerGap()
    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(userLabel)
    .add(pwdLabel)
    .add(statusLabel))
    .add(35, 35, 35)
    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(layout.createSequentialGroup()
    .add(submitButton)
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
    .add(changePwdButton))
    .add(passwordField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 230, Short.MAX_VALUE)
    .add(userTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 230, Short.MAX_VALUE)
    .add(org.jdesktop.layout.GroupLayout.TRAILING, jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 230, Short.MAX_VALUE))
    .addContainerGap())
    layout.setVerticalGroup(
    layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(layout.createSequentialGroup()
    .addContainerGap()
    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
    .add(userLabel)
    .add(userTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
    .add(pwdLabel)
    .add(passwordField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(statusLabel)
    .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
    .add(15, 15, 15)
    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
    .add(submitButton)
    .add(changePwdButton))
    .addContainerGap(27, Short.MAX_VALUE))
    pack();
    }// </editor-fold>
    private void submitButtonKeyTyped(java.awt.event.KeyEvent evt) {                                     
    if(evt.getKeyCode() == KeyEvent.VK_ENTER) {
    submitButton.doClick();
    submitButton.requestFocus();
    changePwdButton.requestFocus();
    private void changePwdButtonActionPerformed(java.awt.event.ActionEvent evt) {                                               
    String command = evt.getActionCommand();
    if(command.equals("Change password")) {
    passwordField.setText("");
    //Get connection to the changing password panel
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new ChangePassword().setVisible(true);
    private void submitButtonActionPerformed(java.awt.event.ActionEvent evt) {                                            
    // TODO add your handling code here:
    String command = evt.getActionCommand();
    if(command.equals("Submit")) {
    user = getUser();
    pwd = getPwd();
    data = new JDBCAdapter(server, driver, userName, password);
    data.executeQuery("SELECT * FROM USERTABLE");
    colUserNames = data.getColumnNames();
    userTable = data.getDataTable();
    if(colUserNames.elementAt(0).equals("")) {
    statusTextArea.setText("Can not connect to database");
    boolean checkUser = false;
    int i = 0;
    while(!checkUser && i<userTable.size()) {
    if(user.equalsIgnoreCase((String) userTable.elementAt(i).elementAt(0))) {
    //Find the user in database
    checkUser = true;
    //Check user's password
    if(pwd.equals((String)userTable.elementAt(i).elementAt(1))) {
    //Check for initial default password. The user is requested
    //to change his password
    if(pwd.equals((String) "dime")) {
    statusTextArea.setText("You are requested to change your " +
    "initial assigned password. Click 'Change password' please.");
    else {
    //Set UserConnection Panel to invisible
    setVisible(false);
    dispose();
    //Get connection to the table
    if(userTable.elementAt(i).elementAt(2).equals("0")) {
    //Get connection to non-editable table
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    PVRackReportNonEdit rackReport = new PVRackReportNonEdit();
    rackReport.createAndShowDialog();
    else {
    if(userTable.elementAt(i).elementAt(2).equals("1")) {
    //Get connection to editable table
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    PVRackReport rackReport = new PVRackReport(user);
    rackReport.createAndShowDialog();
    //PVRackReport rackReport = new PVRackReport();
    else statusTextArea.setText("You do not get approval for viewing data. " +
    "Please contact the administrator for details.");
    else {
    passwordField.setText("");
    statusTextArea.setText("Please enter corrected password or" +
    "the administrator for details.");
    i++;
    if(!checkUser) {
    passwordField.setText("");
    statusTextArea.setText("Not find such user's name." +
    "contact the admistrator for details.");
    private void submitButtonMouseClicked(java.awt.event.MouseEvent evt) {                                         
    // TODO add your handling code here:
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new UserConnection().setVisible(true);
    public String getUser() {
    return userTextField.getText();
    public String getPwd() {
    return passwordField.getText();
    // Variables declaration - do not modify
    private javax.swing.JButton changePwdButton;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JPasswordField passwordField;
    private javax.swing.JLabel pwdLabel;
    private javax.swing.JLabel statusLabel;
    private javax.swing.JTextArea statusTextArea;
    private javax.swing.JButton submitButton;
    private javax.swing.JLabel userLabel;
    private javax.swing.JTextField userTextField;
    // End of variables declaration
    Here is my JDBCAdapter
    package rackdemo2;
    * This is an adaptor which transforms the JDBC interface
    * to the PVRackTableDialogue
    import java.util.Vector;
    import java.sql.*;
    import javax.swing.table.AbstractTableModel;
    import javax.swing.event.TableModelEvent;
    public class JDBCAdapter {
    Connection connection;
    Statement statement;
    ResultSet resultSet;
    Vector<String> columnNames = new Vector<String>();
    Vector<Vector<String>> rows = new Vector<Vector<String>>();
    ResultSetMetaData metaData;
    public JDBCAdapter(String url, String driverName,
    String user, String passwd) {
    try {
    Class.forName(driverName);
    connection = DriverManager.getConnection(url, user, passwd);
    statement = connection.createStatement();
    catch (ClassNotFoundException ex) {
    System.err.println("Cannot find the database driver classes.");
    System.err.println(ex);
    catch (SQLException ex) {
    System.err.println("Cannot connect to this database.");
    System.err.println(ex);
    public void executeQuery(String query) {
    if (connection == null || statement == null) {
    System.err.println("There is no database to execute the query.");
    return;
    try {
    resultSet = statement.executeQuery(query);
    metaData = resultSet.getMetaData();
    int numberOfColumns = metaData.getColumnCount();
    // Get the column names and cache them.
    // Then we can close the connection.
    for(int column = 0; column < numberOfColumns; column++) {
    columnNames.addElement(metaData.getColumnLabel(column+1));
    // Get all rows.
    while (resultSet.next()) {
    Vector<String> newRow = new Vector<String>();
    for (int i = 1; i <= columnNames.size(); i++) {
    String tempString = resultSet.getString(i);
    if(!tempString.equals("null")) {
    newRow.addElement(tempString);
    else {
    newRow.addElement("");
    rows.addElement(newRow);
    //Modify dataTable to add empty row to separate chassis
    if(numberOfColumns>1) {
    int nRow = rows.size();
    Vector<String> row = new Vector<String>();
    for(int i=0; i<numberOfColumns; i++){
    row.add("");
    if(nRow>0 || numberOfColumns>0) {
    //Adding blank row to separate chassis
    int i = 0;
    while(i<nRow) {
    if(!rows.elementAt(i).elementAt(0).equals("")) {
    if(i>0) {
    rows.add(i, row);
    i++;
    nRow = rows.size();
    i++;
    close();
    catch (SQLException ex) {
    System.err.println(ex);
    public void close() throws SQLException {
    resultSet.close();
    statement.close();
    connection.close();
    // MetaData
    public Vector<String> getColumnNames() {
    return columnNames;
    public Vector<Vector<String>> getDataTable() {
    return rows;
    public int getColumnCount() {
    return columnNames.size();
    // Data methods
    public int getRowCount() {
    return rows.size();
    }

    Thank you for your answer.
    I'm very new to mySql as server. When I was assigned
    to write the application, the administrator has set
    up mySql database in the company web server for my
    application. My program runs very when using my
    workplace desktop with java web start or with java
    web start in netbeans (all paths should be link to my
    desktop hard disk, i.e. users/application/). I can
    not run the application at home because I can not
    access to the company intranet server (for security
    purpose). The problem happens when I post the
    application in the company web page (I have to modify
    all paths in jnlp file to the company web address).
    The program then runs without exception except it
    seems that it gets no data from the database (for
    example, when I type my username, it returns that
    "There is no such user name. contact.." as what I
    code in the application for not correcting user name)
    It happens for not only using my company desktop but
    also for others.
    Please help me.
    Thank you in advance.And all this could have been answered yesterday, in your other thread, when I asked you "Is the DB configured to allow that user to connect to the DB from where that user is attempting to connect from?"
    Seeing as how you get that error, the obvious answer was, "No." At which point we could have continued.
    Configure the needed users into the DB, without forgetting to allow them access from the machines from which they are going to access from.
    Although, I agree with Rene, that you should set up a server of some sort, located on the same machine as the DB, for communicating with the DB.

  • Failed to retrieve data from the database using Crystal Reports XI R2

    I am using Crystal reports XI R2 and using the Universal Web Connector (connecting to Coghead).  When I put some some of the fields from the database and run Preview I get "Failed to retrieve data from the database." .   Where is this message coming from and how can I track down what the issue is?

    Hi Jamie,
    When you are trying to Browse Data of a field it is not poping up any window menas, it is unable to interact with database and get the data from database.
    Try to create a new report using ODBC with Xtreem Sample Database.  If you get the data in your report without any error then your connector is not working / unable to pull the data into your report.
    You can find the supported platforms document in below link
    http://support.businessobjects.com/documentation/supported_platforms/xi_release2/default.asp
    Thanks,
    Sastry

  • How to retrive data from MYSQL database beginner question

    I need to know a method, on how to retrieve values from a MYSQL database. I finally managed to insert data to a MySql database using hibernate, with the help of google. but, i couldn't find any helpful article on google, on retrieving data, will some plzz help me, by directing me to a site that has sample codes ??
    i am actually new to MYSql and Databases in java, so plzz do help me, i am lost here,,, :(

    Oh, it's Hibernate. In the future, please use the forums at their own site.
    Answers on how to use Hibernate are usually available in the excellent "Hibernate Reference Documentation" available here.

Maybe you are looking for