XML into Mysql Database

Hi,
I recently purchased The Dreamweaver developer toolbox, and I thought there was a behavior to import an XML file into a database (because dreamweaver bought interakt software http://www.interaktonline.com/Products/Dreamweaver-Extensions/XMLImport-Export/Statement/ )
But now I see it isn't possible anymore.
Is there someone who can help me to find a decent extention (php/mysql) to import an external xml into mysql database?
Kind Regards,
Bertel

Not DW extensions, but plenty of classes to do it at...
http://www.google.com/custom?domains=www.phpclasses.org&q=XML+import&sa=Search&sitesearch= www.phpclasses.org&client=pub-2951707118576741&forid=1&channel=5742870948&ie=ISO-8859-1&oe =ISO-8859-1&cof=GALT%3A%23663399%3BGL%3A1%3BDIV%3A%23222222%3BVLC%3A663399%3BAH%3Acenter%3 BBGC%3AA3C5CC%3BLBGC%3AA3C5CC%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3B GIMP%3A0000FF%3BLH%3A50%3BLW%3A256%3BL%3Ahttp%3A%2F%2Ffiles.phpclasses.org%2Fgraphics%2Fgo oglesearch.jpg%3BS%3Ahttp%3A%2F%2Fwww.phpclasses.org%2Fsearch.html%3BFORID%3A1%3B&hl=en

Similar Messages

  • Serialization big object(100k--2M) into MYSQL database

    Hi all !
    I have a big object need to be persisted into MYSQL database in my application.
    I use two method to meet this request
    1 ---- the object implement interface Serializable, but there is serializationVersionID is not same Exception
    sometimes.
    2 ---- Use XMLEncoder to save my object, the XMLEncoder generate the object XML text about 200k -- 3 M
    , but another problem occur :
    when I call flush method of XMLEncoder, my application will full ocuppy CPU time, and memory usage will increase to 90M, sometimes will ocurr "Not enough memory" Error.
    Why?
    can some one help me?
    Thanks in advanced

    1. You are modifying the signature of one or more of your classes that alters the (system generated) serializationVersionUID and then recompiling. You can declare this for yourself to get control to some extent. See the serialization spec for details.
    2. Your object graph is very large, which might be a problem using native or xml formats. Again, the specification details ways in which you can control the serialized form of your objects.
    On the information you've provided there's not much more that can be said.

  • How to update transaction data automatically into MySQL database using PI

    Dear All,
    With reference to subject matter I want a sincere advice regarding how to update transaction data automatically into MySQL database using PI. Is there any link available where I can get step-by-step process.
    Ex: I have a MYSQL database in my organization. Whenever a delivery created in SAP some fields like DO Number, DO quantity, SO/STO number should get updated in MYSQL database automatically.
    This scenario is related to updation of transactional data into MYSQL DB and I want your suggestions pertaining to same issue.
    Thanks and Regards,
    Chandra Sekhar

    Hi .
    Develop a sceanrio between SAP to Database system,When the data updates in SAP Tables read the data and update it in DATA Base using JDBC adapter,but there will be some delay in updating data in MySQL.
    serach in sdn for IDOC-TOJDBC sceannario,many documents available for the same.
    Regards,
    Raja Sekhar

  • Upload image into mysql database residing on  remote server is not working?

    hello to all,
    i need ur help,we hav online site .
    i have to upload image(which can b from any pc) into mysql database residing on remote server of which we (don't hav actual path of that server).
    the solution i'm using is working correctly on local bt when transfer it to server it shows
    java.io.FileNotFoundException: (No such file or directory)
    i have used multipartRequest to access parameter of file type input.
    all variables and related packages r imported properly.no prblm in that.
    code is here....................................
    try {
    MultipartRequest multi = new MultipartRequest(request, ".", 500000 * 1024);
    File f = multi.getFile("uploadfile");
    out.println(f.getName());
    filename = f.getName();
    String type = multi.getContentType(f.getName());
    fis=new FileInputStream(filename);
    byte b[]=new byte[fis.available()];
    fis.read(b);
    fis.close();
    Blob blob=new SerialBlob(b);
    Class.forName("com.mysql.jdbc.Driver");
    Connection con=DriverManager.getConnection("jdbc:mysql://10.1.52.206:3306/test?user=root&password=delhi");
    String query="insert into uploads (FILENAME,BINARYFILE,) values (?,?)";
    pstmt=con.prepareStatement(query);
    pstmt.setString(1,filename);
    pstmt.setBlob(2,blob);
    int i=pstmt.executeUpdate();
    if(i>0)
    out.println("Image Stored in the Database");
    else
    out.println("Failed");
    } catch (Exception ex) {
    out.print("*******************"+ex);
    ex.printStackTrace();
    please suggest me the way to upload image to remote server** not on local server.
    its urgent.
    Edited by: JavaDevS on Jul 28, 2008 11:41 AM

    i need ur help,we hav online site .Please don't use these juvenile abbreviations. It's impolite when you're asking for assistance not to make the effort to spell out all of the words. Moreover in a forum with an international readership the use of standard English will reduce the possibility of confusion.
    I presume that your file upload is being placed in a different directory from that which you were expecting. I would suggest logging all paths (specifically filename) to see if this is an unexpected value.
    Please explain further what you mean by "local" - is this a stand-alone application, or merely running a copy of the server on your local machine and doing the transfer (via the browser) to that? Are there any other differences such as the browser used?

  • Parsing XML data into MySQL database

    I need to parse data from an xml document rsiding on amother
    server into a mysql database residing on my server, so that I can
    pull data into a php site.
    Any help? Mybe there's a commercial script or something?
    I would also need to update the data daily
    Thanks!!

    Check this out.
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_xmlsav.htm#1008593

  • Program to import xml into mysql

    Hello, I am trying to find a program that will get the url of an xml page, and it will convert it into a mysql table. I have managed to find a couple of programs that do this kind of thing, such as Exult professional edition for MySqL and Navicat, but a) They are both trial versions and their full versions require payment and b) The Navicat program can convert from xml files that are saved inside the computer. But I need the program to get the url of the xml page, because I need the database to be updated when the xml page is updated. Can anyone help me with this please?Thank you very much!

    There are certain websites that provide XML feeds about some events that will occure in different places. I want to retrieve these XML pages from 3 different websites in order to create a jsf project. I want to input the information that these XML pages contain into a database because I want to create queries. the information is like this:
    <news groupName="news" type="group">
    &#8722;
         <news_name dataType="RawString" fieldName="news_name" href="http://www.epractice.eu/document/4506" originalElement="span" type="field">
    AT/DE: Administrations can network � wiki shows the way
    </news_name>
    &#8722;
         <news dataType="RawString" fieldName="news" originalElement="div" type="field">
    Efficiency & Effectiveness, Benchmarking, Interoperability and infrastructure, Open Source, eServices for Citizens
    </news>
    <loc dataType="RawString" fieldName="loc" originalElement="span" type="field">Austria, Germany</loc>
    &#8722;
         <news dataType="RawString" fieldName="news" originalElement="div" type="field">
    Using Web 2.0 and semantic technologies, the new Austrian-based platform documents best practice examples of co-operation between administrations at all levels of government. By the end of its first month, it had 53 project descriptions on-line,...
    </news>
    </news>

  • Problem with inserting data into mySQL database with jsp

    I have a jsp page that collects infromation about a users vehicle and puts the data into a mySQL database. Iv'e been messing around with it for ages & i can't seem to get it to work even though i cannot see anything wrong with the code, which can be seen below.
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ include file="Connections/connection.jsp" %>
    <%
    // *** Restrict Access To Page: Grant or deny access to this page
    String MM_authorizedUsers="";
    String MM_authFailedURL="login_form.jsp";
    boolean MM_grantAccess=false;
    if (session.getValue("MM_Username") != null && !session.getValue("MM_Username").equals("")) {
      if (true || (session.getValue("MM_UserAuthorization")=="") ||
              (MM_authorizedUsers.indexOf((String)session.getValue("MM_UserAuthorization")) >=0)) {
        MM_grantAccess = true;
    if (!MM_grantAccess) {
      String MM_qsChar = "?";
      if (MM_authFailedURL.indexOf("?") >= 0) MM_qsChar = "&";
      String MM_referrer = request.getRequestURI();
      if (request.getQueryString() != null) MM_referrer = MM_referrer + "?" + request.getQueryString();
      MM_authFailedURL = MM_authFailedURL + MM_qsChar + "accessdenied=" + java.net.URLEncoder.encode(MM_referrer);
      response.sendRedirect(response.encodeRedirectURL(MM_authFailedURL));
      return;
    String vehicle_details__registration = null;
    if(request.getParameter("txt_registration") != null){ vehicle_details__registration = (String)request.getParameter("txt_registration");}
    String vehicle_details__make = null;
    if(request.getParameter("txt_make") != null){ vehicle_details__make = (String)request.getParameter("txt_make");}
    String vehicle_details__model = null;
    if(request.getParameter("txt_model") != null){ vehicle_details__model = (String)request.getParameter("txt_model");}
    String vehicle_details__colour = null;
    if(request.getParameter("txt_colour") != null){ vehicle_details__colour = (String)request.getParameter("txt_colour");}
    String vehicle_details__tax_class = null;
    if(request.getParameter("select_tax_class") != null){ vehicle_details__tax_class = (String)request.getParameter("select_tax_class");}
    String vehicle_details__chasis_num = null;
    if(request.getParameter("chasis_num") != null){ vehicle_details__chasis_num = (String)request.getParameter("chasis_num");}
    String vehicle_details__status = null;
    if(request.getParameter("radio_status") != null){ vehicle_details__status = (String)request.getParameter("radio_status");}
    String owner_details__MMColParam = "1";
    if (session.getValue("MM_Username") !=null) {owner_details__MMColParam = (String)session.getValue("MM_Username");}
    Driver Drivervehicle_details = (Driver)Class.forName(MM_connection_DRIVER).newInstance();
    Connection Connvehicle_details = DriverManager.getConnection(MM_connection_STRING,MM_connection_USERNAME,MM_connection_PASSWORD);
    PreparedStatement vehicle_details = Connvehicle_details.prepareStatement("INSERT INTO vehicle_man_db.vehicle_details (registartion, make, model, colour, tax_class, chasis_num) VALUES ('"+ String vehicle_details__registration + "', '"+ String vehicle_details__make + "', '"+ String vehicle_details__model + "', '"+ String vehicle_details__colour + "', '"+ String vehicle_details__tax_class + "', '"+ String vehicle_details__chasis_num + "', '"+ String vehicle_details__status + "')");
    vehicle_details.executeUpdate();
    %>
    <form name="add_vehicle_form" id="add_vehicle_form">
      <p>Registration mark:
        <input name="txt_registration" type="text" id="txt_registration">
    </p>
      <p>Make:
        <input name="txt_make" type="text" id="txt_make">
    </p>
      <p>Model:
        <input name="txt_model" type="text" id="txt_model">
    </p>
      <p>Colour:
        <input name="txt_colour" type="text" id="txt_colour">
      </p>
      <p>Tax Class:
        <select name="select_tax_class" id="select_tax_class">
          <option value="AAA">Band AAA (up to 100g/km)</option>
          <option value="AA">Band AA (101 - 120g/km)</option>
          <option value="A">Band A (121 - 150g/km)</option>
          <option value="B">Band B (151 - 165g/km)</option>
          <option value="C">Band C (166 - 185g/km)</option>
          <option value="D">Band D (Over 185g/km)</option>
        </select>
      </p>
      <p>Chasis Number:
        <input name="txt_chassis_num" type="text" id="txt_chassis_num">
    </p>
      <p>Status: active:
        <input name="radio_status" type="radio" value="1" checked>
        off-road
        <input name="radio_status" type="radio" value="0">
      </p>
      <p>
        <input type="submit" name="Submit" value="Submit">
    </p>
    </form>
    <%
    Connvehicle_details.close();
    %>This is the error I am getting from the server
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 3 in the jsp file: /add_vehicle_form.jsp
    Generated servlet error:
    C:\Servers\Tomcat 5.0\work\Catalina\localhost\Assignment\org\apache\jsp\add_005fvehicle_005fform_jsp.java:113: ')' expected
    PreparedStatement vehicle_details = Connvehicle_details.prepareStatement("INSERT INTO vehicle_man_db.vehicle_details (registartion, make, model, colour, tax_class, chasis_num) VALUES ('"+ String vehicle_details__registration + "', '"+ String vehicle_details__make + "', '"+ String vehicle_details__model + "', '"+ String vehicle_details__colour + "', '"+ String vehicle_details__tax_class + "', '"+ String vehicle_details__chasis_num + "', '"+ String vehicle_details__status + "')");
    ^
    1 error
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Any help would be much appreciated.
    Thanks

    use this ...
    PreparedStatement vehicle_details =
    Connvehicle_details.prepareStatement("INSERT INTO
    vehicle_man_db.vehicle_details (registartion, make,
    model, colour, tax_class, chasis_num) VALUES
    vehicle_details .setString(1,String
    vehicle_details__registration );
    vehicle_details setString(2,String
    vehicle_details__make );
    vehicle_details .setString(3,String
    vehicle_details__model );
    vehicle_details .setString(4,vehicle_details__colour
    vehicle_details .setString(5,String
    vehicle_details__tax_class);
    vehicle_details .setString(6,String
    vehicle_details__chasis_num );
    vehicle_details .executeQuery();Even you need a screwing up... what's the point putting that String inside. That's the bloody error.

  • Inserting user variables into MYSQL database using servlet

    I have a servlet that recieves user entered parameters from an html form and inserts them into a user table in MYSQL, or at least is supposed to. I can get it to update the table with specific values but not with the user variables. I know the single quote marks are for inserting specific values but without them it doesn't properly work.
    The parameters are parsed correctly into the variables, so I just can't figure out how to ge tthe variables into the database. Any help would be wonderful
    register.html:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
      <TITLE>Register</TITLE>
    </HEAD>
    <BODY BGCOLOR="#FDF5E6">
    <CENTER><IMG SRC="dvdti.jpg" ALIGN=middle >   </CENTER>
    <HR>
    <H1 ALIGN="CENTER">Please enter your registration details:</H1>
    <FORM ACTION="http://localhost:8080/examples/servlet/Assignment1.register">
      <BR>First Name: <input type="text" NAME="Ufirst_name"><BR>
      <BR>Last Name: <input TYPE="TEXT" NAME="Ulast_name"><BR>
      <BR>Address: <INPUT TYPE="text"  name="Uaddress"><BR>
      <BR>E-mail:     <INPUT TYPE="TEXT" NAME="Uemail"><BR
      <BR>Password: <INPUT TYPE="password" NAME="Upassword"><BR>
      <CENTER>
        <INPUT TYPE="SUBMIT" VALUE="Register">
      </CENTER>
    </FORM>
    </BODY>
    </HTML>
    register.java:
    package Assignment1;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    // Connects to a database to retrieve music data
    public class register extends HttpServlet {
      public void doGet(HttpServletRequest request,
                        HttpServletResponse response)
          throws ServletException, IOException {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
    // Database connection code starts here
         Connection conn = null;
         // loading jdbc driver for mysql (help in mysql.jar file in classpath)
         try{
             Class.forName("com.mysql.jdbc.Driver").newInstance();
         } catch(Exception e) {
             System.out.println(e);
         // connecting to database
         try{
              // connection string for demos database, username demos, password demo-pass
             conn = DriverManager.getConnection
            ("jdbc:mysql://mudfoot.doc.stu.mmu.ac.uk:3306/roddiea?user=roddiea&password=");
              System.out.println("Connection to database successful.");
           catch(SQLException se) {
             System.out.println(se);
    // Create select statement and execute it
      try        { Statement stmt2 = conn.createStatement();
              // Get the regdetails from the reg form
               String Ufirst_name = request.getParameter("Ufirst_name");
               String Ulast_name = request.getParameter("Ulast_name");
               String Uaddress = request.getParameter("Uaddress");
               String Uemail = request.getParameter("Uemail");
                  String Upassword = request.getParameter("Upassword");
              stmt2.executeUpdate("INSERT INTO customer(first_name, last_name, address, email, password)" + "VALUES('Ufirst_name', 'Ulast_name', 'Uaddress', 'Uemail', 'Upassword')");
              System.out.println (stmt2);
              out.println(stmt2);
              out.println(Ufirst_name + Ulast_name + Uaddress + Uemail + Upassword);
        // close the html
        out.println("</BODY></HTML>");
              stmt2.close();
             conn.close();
         }catch(SQLException se) {
             System.out.println(se);
    }Message was edited by:
    Altered_Carbon
    Message was edited by:
    Altered_Carbon
    I also realise that this is a more MYSQL titled problem, but those forums look rubbish <_<

    Investigate PreparedStatement.
    Currently you're trying to insert a value "Ufirst_name" instead of the value of the variable called Ufirst_name.
    It's possible to do this (you could do something like this: "... '" + UfirstName + "' ...") but DEFINITELLY NOT RECOMMENDED. Instead use a prepared statement.
    D.

  • How to insert encrypted data by using blowfish into mysql database

    Hi
    I have encrypted data using blowfish algorithm . And i tried to insert that encrypted data into mysql. it was stored but i dont know that it stores in the same encrypted formate
    When i am trying to get the encrypted data from the mysql database and decrypting that data i am getting errors.
    Exception are like
    input length should be multiple of 8 bits
    or Given block are not properly padded
    and when i am displaying the data using system.out.println ();
    the string is not similar to the string which is in database.
    what is the problem how can i solve my problem
    thank you

    It sounds like your column is a VARCHAR so you need to Base64 or Hex encode the cipertext bytes before putting them in the database.

  • Loading Large XML into Oracle Database

    Hi,
    I am fairly new to XML DB. I have been successful in registering a schema to a table in the Database. Now, I have to load the appropriate XML into that table. I am using the Simple Bulk Loader program found on this oracle site, however, when I load my XML file I get the following error: ORA-21700: object does not exist or is marked for delete.
    So, I figured maybe simple bulk loader cannot handle large files? So I reduced my XML file and loaded it with the program and it worked. However, does anyone know how I can load large files into my registered schema table.
    Thanks,
    Prerna :o)

    Did you specify genTables true or false when registering the XML Schema ?
    Does you XML schema contain a recursive definition
    Is it possible that after reducing the size of the document you no longer have nodes that contain recursive structures...

  • Uploading a file into mySQL database?

    Hello, everybody.
    Can anyone give me a code snippet or at least a hint, how could I upload a file into the BLOB field of mySQL database using JSP webpage? How do you generally store uploaded files on the server? If anyone could suggest a good algorythm of saving the files in the server's file system and saving only their URLs in the database (this was my initial idea), I would be ready to accept this as well.
    Would be appreciated for any help.

    Hi
    Fou uploading the files from client site to server user the utility given by oreilly Go to this site and down the code for uploading the source code for fileupload
    For writing this code to database use this code
    code
    import java.sql.*;
    import java.io.*;
    class BlobTest {
         public static void main(String args[]) {
              try {
                   //File to be created. Original file is duke.gif.
                   DriverManager.registerDriver( new org.gjt.mm.mysql.Driver());
                   Connection conn = DriverManager.getConnection("jdbc:mysql://agt_229/test","manoj","manoj");
                   /*PreparedStatement pstmt = conn.prepareStatement("INSERT INTO BlobTest VALUES( ?, ? )" );
                   pstmt.setString( 1, "photo1");
                   File imageFile = new File("duke.gif");
                   InputStream is = new FileInputStream(imageFile);
                   pstmt.setBinaryStream( 2, is, (int)(imageFile.length()));
                   pstmt.executeUpdate();
                   PreparedStatement pstmt = conn.prepareStatement("SELECT image FROM testblob WHERE Name = ?");
                   pstmt.setString(1, args[0]);
                   RandomAccessFile raf = new RandomAccessFile(args[0],"rw");
                   ResultSet rs = pstmt.executeQuery();
                   if(rs.next()) {
                        Blob blob = rs.getBlob(1);
                        int length = (int)blob.length();
                        byte [] _blob = blob.getBytes(1, length);
                        raf.write(_blob);
                   System.out.println("Completed...");
              } catch(Exception e) {
                   System.out.println(e);
    end of code
    this code contain both inserting into table and retrieving from table

  • How to save values form all row in dynamic table into mysql database?

    hello guys..
    i got some problem on developing expert system using adobe dreamweaver and mysql.
    i've create a dynamic table and have some value from different row. i want to save values from all row to mysql database.. unfortunately.. i'm failed to do that.. for now, i just can save value from first row.
    kindly you can help me to solve this problem.. or maybe there is any tutorial i can follow..
    thank you in advance.
    this is my script for dynamic table
    <table border="1" cellpadding="1" cellspacing="1">
      <tr>
        <td>namaSoalan</td>
        <td>jaw</td>
      </tr>
      <?php do { ?>
        <tr>
          <td><?php echo $row_Recordset1['namaSoalan']; ?></td>
          <td><label for="9"></label>
            <select name="9" id="9">
              <option value="value" <?php if (!(strcmp("value", $row_Recordset1['namaSoalan']))) {echo "selected=\"selected\"";} ?>>sila</option>
              <option value="" <?php if (!(strcmp("", $row_Recordset1['namaSoalan']))) {echo "selected=\"selected\"";} ?>>ya</option>
              <option value="0" <?php if (!(strcmp(0, $row_Recordset1['namaSoalan']))) {echo "selected=\"selected\"";} ?>>tidak</option>
            </select>       
            <label for="u"></label></td>
        </tr>
        <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
    </table>

    dear bregent and SnakEyez02.
    i have create 2 table, which is soalan table and temporary table.
    user will answer all the question. either 'ya' or 'tidak'..
    each answer have different value..
    this value store permanently in soalan table..
    this value i want save to temporary table too.
    for now, i success only save for the first row but i want save for all..
    anybody please help me..

  • How to insert data into mysql database using GUI?

    HI there,
    I have created a GUI application using Netbeans 6.7.1 in which there are three jtextfields. Now from those text fields i have to insert data in the mysql database. I have already connected to mysql using drivers and URL which is used to connect to DB. So what code should i write in the source of these text fields. Please help me and give the code to it.
    I actually don't know what code to be written in the source of a text field.
    Thank You.

    Yo buddy i didn't mean that. I wanted to say that if you see my project then it will be easy for you to help me. okay have a look at this code and tell me i have just created my gui
    This is Main.java -->
    package bookdatabase2;
    import java.sql.*;
    import java.awt.*;
    import javax.swing.*;
    * @author Mohd Azeem
    public class Main {
    * @param args the command line arguments
    public static void main(String[] args)throws Exception {
    // TODO code application logic here
    Class.forName("com.mysql.jdbc.Driver");
    Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/books","root","");
    //PreparedStatement state=con.prepareStatement("select * from titles");
    //ResultSet result=state.executeQuery();
    //while(result.next()){
    // System.out.println(result.getString(1)+" "+result.getString(2)+" "+result.getString(3)+" "+result.getString(4));
    This the gui i have created
    BookDatabase.java -->
    package my.bookdatabase;
    import java.sql.*;
    import javax.swing.*;
    public class BookDatabase extends javax.swing.JFrame {
    public BookDatabase()throws Exception {
    Class.forName("com.mysql.jdbc.Driver");
    Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/books","root","");
    initComponents(); }
    private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {                                           
    // TODO add your handling code here:
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    // TODO add your handling code here:
    public static void main(String args[])throws Exception {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    try{
    new BookDatabase().setVisible(true);}
    catch(Exception e){}
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTextField jTextField5;
    private javax.swing.JTextField jTextField6;
    private javax.swing.JTextField jTextField7;
    // End of variables declaration
    Now tell me what to do?
    i have only created the gui but unable to run it
    when i click on run only main.java is being executed
    but bookdatabase.java is not getting executed?
    what should i do please help?

  • Loging a user into mysql database example

    I'm looking for a clear example or tutorial on loging a user into a mtSQL database.  I don't want an automatic login like you get with the Flex Builder's db wizard.  What I have is a screen where the user enters a user name and password and then clicks a button to login.  I need to be able to handle the user not entering the correct user name or password, that is handling the mySQL rejecting the login.  I have done several serches both here and google and don't seem to find anything like I need.  Can anybody out there point me in the right direction?

    This is actually a faily simple thing to do...at least I think this is what you are trying to do based on what you said:
    Here is the code for the MXML to put together the login UI:
    <mx:Panel width="446" height="199" layout="absolute" title="Login" id="loginpanel">
            <mx:Label x="26" y="58" text="Username:"/>
            <mx:Label x="53" y="86" text="Password:"/>
            <mx:TextInput x="121" y="56" id="username"/>
            <mx:TextInput x="121" y="84" id="password" displayAsPassword="true"/>
            <mx:Button x="219" y="114" label="Log In" id="Submit" click="login_user.send()"/>
    </mx:Panel>
    you need an HTTPService call (which the Submit button above sends) to the PHP file that will check the user's credentials against what is in the DB:
    (mind you, I would encrypt the password on the client side too before sending it over to the PHP file)
    <mx:HTTPService id="login_user" result="checkLogin(event)" method="POST" url="login.php" useProxy="false">
            <mx:request xmlns="">
                <username>{username.text}</username>
                <password>{password.text}</password>
            </mx:request>
    </mx:HTTPService>
    now, the result of the HTTPService goes to a function called checkLogin(event) which is:
    import mx.rpc.events.ResultEvent;
    private function checkLogin(evt:ResultEvent):void
            if(evt.result.loginsuccess == "yes"){
                //user is GOOD, do something now
            if(evt.result.loginsuccess == "no"){
                mx.controls.Alert.show("Invalid username/password");
    and for the PHP file, it checks against the DB and generates an XML which is kicks back to Flex:
    <?php
    //connect to DB however you do it, I have a function db_connect() that I call
    $conn = db_connect();
    $username = mysql_real_escape_string($_POST['username']);
    $password = mysql_real_escape_string($_POST['password']);
    //if you have encryption, then make sure you do that here (md5 or whatever)
    //also, make sure you do validation of the input for SQL Injections and XSS attacks, but I'm not covering that here
    $query = "SELECT * FROM usertable WHERE username = '$username' AND password = '$password'";
    $result = mysql_fetch_array(mysql_query($query));
    $output = "<loginsuccess>";
    if(!$result) {
        $output .= "no";
        $output .= "</loginsuccess>";  
    } else {
        $output .= "yes";
        $output .= "</loginsuccess>";
    print ($output);
    ?>

  • Issue after succesfully loading xml into 11gr2 database

    Hi All,
    I'm currently experiencing an issue with a project I'm working on at a customer:
    I have succesfully loaded multiple xml files into the Oracle 11gr2 database using sqlloader and since the intention is to be able to query the loaded data, it needs
    to be transferred from the xml table to a 'normal' table, which also went ok.
    Since most of the XML files contain multiple records, i've used the fn:string-join option in the insert into....select statement and used a ; as delimiter.
    This is where I've encountered the thing that I can't seem to find a solution for.
    When there's multiple records in the xml file it inserts all the records into one record.
    So say i've got an xml file containing info for a bunch of electricity meters consisting of the fields brand, supplier, type for 3 records (actual files can be uploaded if neccesary)
    inserting the data by using the above construction gives me the following data in the destination table:
    Brand
    BrandA;BrandB;BrandC
    Supplier
    Company1;Company2;Company3
    Type
    Type1;Type2;Type3
    How do I split up the above info so that every separate record from the imported xml file lands in its own record?
    Thanks in advance!
    Cheers,
    E.

    Thanks, I'm curious on how you'll demo it
    Here's the sample xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--XML file generated by Protocol Manager-->
    <tns:Main Company="Company" Supplier="Supplier" xmlns:tns="http://schema.dsmr22plus.com/delivery/v1.0.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schema.dsmr22plus.com/delivery/v1.0.5 ..\..\..\xmllib\bla\DeliveryFile.xsd">
    <tns:Header DeviceType="ME382-D1 GPRS" BatchNumber="NC2043W_59" /><tns:DeviceAttributes YearOfManufactory="2011" CoreFirmwareVersion="14DA21B4B6F53C47613466AF8C263209" SerialNumber="50727236" OperationalFirmwareVersion="B330EBC763450ADC3E0C11F9BA0EA732" HardwareVersion="20611978">
    <tns:Emeter>
    <tns:DSMRAttributes DSMRVersion="2.3" BatteryType="Supercap type SG" EquipmentIdentifier=" KAL7005072723611" KemaGastecCode="KAL7" GOVersion="1" />
    <tns:GPRS>
    <tns:DlmsAttributes GlobalEncryptionKeyUnicast="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" GlobalEncryptionKeyBroadcast="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" P0Password1="12345678" AuthenticationKey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" HDLCPassword="12345678" MasterKey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
    <tns:GPRSCommunicationAttributes>
    <tns:SimCard MSISDN="" ICCID="8931084811080544999" CommunicationProviderBatchId="5765" IMSI="204080800339599" CommunicationProvider="KPN" />
    <tns:Modem IMEI="353471006235660" PPPPassword="xxxxxxxxxxxxxxx" PPPUsername="KAL7005072723611" />
    </tns:GPRSCommunicationAttributes>
    </tns:GPRS>
    </tns:Emeter>
    </tns:DeviceAttributes>
    <tns:DeviceAttributes YearOfManufactory="2011" CoreFirmwareVersion="14DA21B4B6F53C47613466AF8C263209" SerialNumber="50727237" OperationalFirmwareVersion="B330EBC763450ADC3E0C11F9BA0EA732" HardwareVersion="20611978">
    <tns:Emeter>
    <tns:DSMRAttributes DSMRVersion="2.3" BatteryType="Supercap type SG" EquipmentIdentifier=" KAL7005072723711" KemaGastecCode="KAL7" GOVersion="1" />
    <tns:GPRS>
    <tns:DlmsAttributes GlobalEncryptionKeyUnicast="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" GlobalEncryptionKeyBroadcast="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" P0Password1="12345678" AuthenticationKey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" HDLCPassword="12345678" MasterKey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
    <tns:GPRSCommunicationAttributes>
    <tns:SimCard MSISDN="" ICCID="8931084811080544981" CommunicationProviderBatchId="5765" IMSI="204080800339598" CommunicationProvider="KPN" />
    <tns:Modem IMEI="353471006235450" PPPPassword="xxxxxxxxxxxxxxx" PPPUsername="KAL7005072723711" />
    </tns:GPRSCommunicationAttributes>
    </tns:GPRS>
    </tns:Emeter>
    </tns:DeviceAttributes>
    </tns:Main>
    Edited by: user6357028 on 12-Nov-2012 04:55

Maybe you are looking for

  • FINANCE-PAYMENT ADVICE - TOTALS ISSUE

    Hi, We generated a payment run using transactionF110, Run date xxxxx , Identification: xxxxxx for Company Code : xxxxxxx Supplier had called to say they did not received the payment advice, pls advise how I could print out the payment advice on site

  • SAP-PM nd Meridium

    Hi All, plz give some inputs on SAP-PM nd Meridium integration .... for wht purpose meridium is used for and its advantages .... regrds pushpa

  • What is the function of the Service Manager, in Concurrent Managers?

    Greetings to All, When looking at the concurrent managers, our internal manager is down and we also have the Service Manager being down. I understand the process of the Internal Manager. But like to know what the Service Manager does and what it is u

  • Address at sapscript form

    Hi, /:   ADDRESS PARAGRAPH AS /:     TITLE    &VBDKL-ANRED& /:     NAME     &VBDKL-NAME1&, &VBDKL-NAME2&, =    &VBDKL_KUNWE&/:     STREET   &VBDKL-STRAS& /:     POBOX    &VBDKL-PFACH& CODE &VBDKL-PSTL2& /:     POSTCODE &VBDKL-PSTLZ& /:     CITY     &

  • UAR Job taking more than 36 hours

    Dear GRC Gurus, We are running our User Access Review on GRC 10 SP13. We have set the Admin review to "Yes" The workflow has been successfully tested with few roles. Now we have kicked off the UAR review data generation job for around 18000 roles. it