I downloaded mySQL and mySQL driver NOW  WHAT ?

I downloaded the mySQL and the mySQL driver. What do I do now ?
I saw a book "mySQL and PHP for Dummies" . What is PHP ?
Can you give me direction ?
(without the "go read the archives" type of non-helpful help ?)
Thank you in advance
Stan

If it's PHP and MySQL you're interested in, why are you posting to a Java forum?
PHP is a Web scripting language:
http://www.php.net/
If you want to use MySQL with Java, you'll have to learn enough about SQL and relational databases to be able to get into MySQL, create some tables and users, and add some data. Then you'll use the MySQL JDBC driver to let your Java app access those database tables and do CRUD operations on them (Create/Read/Update/Delete).
There's a JDBC tutorial under the Tutorials link to the left on this page.
Here's a Java app that will let you run any valid SQL statement you wish against any database:
import java.sql.*;
import java.util.*;
public class DataConnection
    public static final String DEFAULT_DRIVER   = "sun.jdbc.odbc.JdbcOdbcDriver";
    public static final String DEFAULT_URL      = "jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\\Edu\\Java\\Forum\\DataConnection.mdb";
    public static final String DEFAULT_USERNAME = "admin";
    public static final String DEFAULT_PASSWORD = "";
    /** Database connection */
    private Connection connection;
     * Driver for the DataConnection
     * @param command line arguments
     * <ol start='0'>
     * <li>SQL query string</li>
     * <li>JDBC driver class</li>
     * <li>database URL</li>
     * <li>username</li>
     * <li>password</li>
     * </ol>
    public static void main(String [] args)
        DataConnection db = null;
        try
            if (args.length > 0)
                String sql      = args[0];
                String driver   = ((args.length > 1) ? args[1] : DEFAULT_DRIVER);
                String url      = ((args.length > 2) ? args[2] : DEFAULT_URL);
                String username = ((args.length > 3) ? args[3] : DEFAULT_USERNAME);
                String password = ((args.length > 4) ? args[4] : DEFAULT_PASSWORD);
                db = new DataConnection(driver, url, username, password);
                Object result = db.executeSQL(sql);
                System.out.println(result);
            else
                System.out.println("Usage: db.DataConnection <sql> <driver> <url> <username> <password>");
        catch (SQLException e)
            System.err.println("SQL error: " + e.getErrorCode());
            System.err.println("SQL state: " + e.getSQLState());
            e.printStackTrace(System.err);
        catch (Exception e)
            e.printStackTrace(System.err);
        finally
            if (db != null)
                db.close();
            db = null;
     * Create a DataConnection
     * @throws SQLException if the database connection fails
     * @throws ClassNotFoundException if the driver class can't be loaded
    public DataConnection() throws SQLException,ClassNotFoundException
        this(DEFAULT_DRIVER, DEFAULT_URL, DEFAULT_USERNAME, DEFAULT_PASSWORD);
     * Create a DataConnection
     * @throws SQLException if the database connection fails
     * @throws ClassNotFoundException if the driver class can't be loaded
    public DataConnection(final String driver,
                          final String url,
                          final String username,
                          final String password)
        throws SQLException,ClassNotFoundException
        Class.forName(driver);
        this.connection = DriverManager.getConnection(url, username, password);
     * Clean up the connection
    public void close()
        try
            this.connection.close();
        catch (Exception e)
            ; // do nothing; you've done your best
     * Execute ANY SQL statement
     * @param SQL statement to execute
     * @returns list of row values if a ResultSet is returned,
     * OR an altered row count object if not
     * @throws SQLException if the query fails
    public Object executeSQL(final String sql) throws SQLException
        Object returnValue      = null;
        Statement statement     = this.connection.createStatement();
        boolean hasResultSet    = statement.execute(sql);
        if (hasResultSet)
            ResultSet rs            = statement.getResultSet();
            ResultSetMetaData meta  = rs.getMetaData();
            int numColumns          = meta.getColumnCount();
            List rows               = new ArrayList();
            while (rs.next())
                Map thisRow = new LinkedHashMap();
                for (int i = 1; i <= numColumns; ++i)
                    String columnName   = meta.getColumnName(i);
                    Object value        = rs.getObject(columnName);
                    thisRow.put(columnName, value);
                rows.add(thisRow);
            rs.close();
            statement.close();
            returnValue = rows;
        else
            int updateCount = statement.getUpdateCount();
            returnValue     = new Integer(updateCount);
        return returnValue;
}Maybe it'll help get you started with Java and JDBC. You're on your own with PHP. - MOD

Similar Messages

  • Upgraded to LION, and now cannot download new podcasts as usual Now what?

    I upgraded to LION, and now cannot download new podcasts as usual Now what?

    Mac OS X v10.7 Lion Communities
    Why didn't you make a backup and just restore for now?
    RoaringApps Mac OS X Lion Application Compatibility
    The whole PowerPC has been discussed since before Lion came out last June.
    MacBook Pro

  • What is the difference between mysql and mysqli

    hello can any one tell me What is the difference between mysql and mysqli ? i googled but i cant find any
    Edited by: 994030 on Mar 14, 2013 3:43 PM

    Yes. they are the same.

  • What is the difference between mysql and mysql server

    Hi,
    I notice that mysql and mysql server has been used interchangeably, but are they the same thing? could somebody give a brief explanation about this?
    Many thanks.

    Yes. they are the same.

  • How do I have photographs download to external hard drive.  What setting do I use?

    How do I set up my system so that photographs automatically download to external hard drive?  What settings?

    Without knowing more about your workflow its difficult to answer this as there are a number of different ways to accomplish this.
    But assuming that you are asking how to do this in Aperture one way would be to set Aperture's import to store the files on your external drive.
    By selecting the Store Files pulldown and then choosing Choose... you will be able to select a folder on your external drive. (note in the above screen shot the selection is actually In the Aperture Library you would click on Choose.. at the bottom of the pulldown)
    This will cause Aperture to store the files in the folder you indicate and et up the masters as referenced.
    But again it would be better if we had a better idea of what you are trying to acomplich and what your workflow is.
    regards

  • HT1414 while updating iOS 5 my iPhone responses nothing but logo of iTune and USB port, now what can I do?

    while updating iOS 5 my iPhone responses nothing but logo of iTune and USB port, now what can I do?

    Do just like the diagram indicates:  connect your phone to your computer, open iTunes on the computer and then restore.

  • I'm trying to update the latest version of iTunes but my computer gives me an error saying to go to tools then download only and update manually. What do I do?

    I'm trying to update the latest version of iTunes but my computer gives me an error saying to go to tools then download only and update manually. What do I do?

    Try updating using an iTunesSetup.exe (or iTunes64Setup.exe) installer file downloaded from the Apple website:
    http://www.apple.com/itunes/download/

  • Downloaded iOS5 and don't know what happened to my contact list

    I downloaded iOS5 and don't know what happened to my contact list.  Any help?

    try to make a hard reset (home button +power button for 15seconds) then restore by itunes.this is called DFU mode,once you done,can only restore the device by itunes!let me know if it works

  • I downloaded 3.6.6 so now what? What next? What do I have?

    I downloaded 3.6.6. Now what do I do next? I cannot find the areas you mentioned to find out what version I now have. Do I have 3.6.6 yet? I do not like video instructions.

    You can check what version you have by going to Help | About Mozilla Firefox

  • I downloaded the odbc driver, now what?

    i downloaded the odbc driver then unzipped it into c:/unzipped/ folder, now what?
    it was apparently saved as:
    Disk1
    What do i do next?
    Thank you.
    null

    sounds like the the next step would be :
    look at the folder contents,
    read the install and readme files
    follow the instructions,
    and install it

  • I've replaced my optical drive with an SSD drive, now what?

    So now I have a formatted 60GB SSD inside my iMac in the optical drive space, alongside my existing 1.5TB spinning drive which holds the Lion OS.
    What would be the best way to proceed? Should I . . .
    Load up the Lion thumbdrive and install Lion on the SSD (ignoring for now the Lion OS on the 1.5TB drive) and then import all settings from the old drive to the new one?
    I want all system and all applications to be loaded on the SSD drive and the remaining space I plan to use for editing purposes, such as movies, photos etc. Load them onto the fast drive for editing then off onto the spinning drive for archiving and later re-editing and use.
    So once I have a new OS installed on the new drive, what do I delete off of the old drive to get rid of the operating system there without losing any data?
    Just the System folder or the System and Library folders? What about the User folder? It's huge obviously, so I clearly can't bring that in, but are there parts of it that should be on the SSD?
    I'm also running Parallels, so should I drag _that_ applications folder over as well, _out_ of the Users folder? How about the Virtual Machines, the Windows.PVM and Linux.Pvm virtual machines?
    Instead of installing Lion, maybe I should drag the appropriate folders over?
    I'm sure it's going to be a mix of these, but not sure what the optimal mix is.
    Thanks,.
    JoeL
    Atlanta, GA

    So now I have a formatted 60GB SSD inside my iMac in the optical drive space, alongside my existing 1.5TB spinning drive which holds the Lion OS.
    What would be the best way to proceed? Should I . . .
    Load up the Lion thumbdrive and install Lion on the SSD (ignoring for now the Lion OS on the 1.5TB drive) and then import all settings from the old drive to the new one?
    I want all system and all applications to be loaded on the SSD drive and the remaining space I plan to use for editing purposes, such as movies, photos etc. Load them onto the fast drive for editing then off onto the spinning drive for archiving and later re-editing and use.
    So once I have a new OS installed on the new drive, what do I delete off of the old drive to get rid of the operating system there without losing any data?
    Just the System folder or the System and Library folders? What about the User folder? It's huge obviously, so I clearly can't bring that in, but are there parts of it that should be on the SSD?
    I'm also running Parallels, so should I drag _that_ applications folder over as well, _out_ of the Users folder? How about the Virtual Machines, the Windows.PVM and Linux.Pvm virtual machines?
    Instead of installing Lion, maybe I should drag the appropriate folders over?
    I'm sure it's going to be a mix of these, but not sure what the optimal mix is.
    Thanks,.
    JoeL
    Atlanta, GA

  • I install a new hard drive now what??

    i took my laptop to the apple store and it turned out the hard drive shot so i purchased on myself and installed it myself using the website ifixit. everything when well but now what do i do next? i tried to install the software but nothing happen it stops in the middle of installation process.

    Welcome to Apple Discussions!
    Did you format your new drive before attempting to install the software? If not, You need to do this first. Often drives are shipped not formatted for Macs.
    Using your install disc, navigate to Disk Utility. Go to the partition tab and partition your new drive with one partition and be sure the format is "Mac Extended (Journaled) and the Partition Map Scheme is "Apple Partition Map". Once the drive is properly formatted, you should be able to install your software successfully.
    Good luck!

  • Eula has stopped working; put path but did not get and "accept" option  now what?

    I cannot get Adobe Reader 11.0.02 to work and get the message "Eula is not working" .  I searched and performed the recommended path check ie.
    C:\ProgramFiles(x86)\Adobe\Reader11.0\Reader -- but got no option to "accept".
    Now what do I do?

    You double-clicked the Eula.exe ?

  • My ipod switched off and wont start now. what should i do?

    Ipod went off on its own and isnt starting now.

    After conncting to a chargng source for half an hour:
    - Reset the iPod:
    Reset iPod touch:  Press and hold the On/Off Sleep/Wake button and the Home
    button at the same time for at least ten seconds, until the Apple logo appears.
    - Next try connecting it to your computer.  If iTunes sees the iPod, restore the iPod via iTunes
    - If iTunes does not see the iPod. see if placing the iPod in recovery mode will allow iTunes to see the iPod so you can restore the iPod. For recovery mode see:
    iPhone and iPod touch: Unable to update or restore
    - Make an appointment at the Genius Bar of an Apple store

  • I'm trying to install CS6 to one particular drive (f drive) but it partially installs to the c and f drive.  What am I doing wrong?

    Why does the software partially install to both the c and f drive even though I specifically set the installation to the f drive? 

    You cannot get around some of it being installed on the C drive.  It is required to do so.

Maybe you are looking for

  • I get this error in my Web Site, after installing MSM files.

    Background: I've been struggling for 6 weeks to deploy a Web Site with Crystal Reports to a Test Server. After wading thru pages and pages of documentation, some of which had conflicting information, I finally found someone who was able to confirm th

  • BDC using call transaction

    Hi , This is vijay... can anyone help me plz Hi, Iam uploading data using call transaction.Tcode is ff67.In this TCode we have the begining balance(ssald) and ending balance(esald).The new record we are uploading will take the begining balance as the

  • Bal adj account is picked up in payment run for a vendor

    When we do payment program, one additional line item is created for payments in foreign currency other than exchange difference account. The additional line item is created for balance sheet adjustment account which is assigned in foreign currency re

  • Fstream won't take anything but char

    Hi. C++ console programing. Maybe I'm dumb programer, or I've forgoten something, but before xcode 3.2 everything was working fine. Now if I try to read form ifstream object or write to an ofstream I have problems. It looks like it will work only wit

  • Netui tags and javascript

              Hello Gang, not sure if anyone has run into this issue, but here it goes.           I got a netui:form with netui:checkboxes that I need to have a specific type of           functionality.           The first netui:checkbox when checked cal