MySQL help

I have been trying to creat an application recently. One of the menu screens I have created is a User login screen, with a TextField, UserID and a PasswordFeild, Password. I has also made a simple database for test purposes and have included fields inside it for UserID and Password. The database has been done using MySQL. How can I connect to it and use the values stored in the table to verify the details entered by anyone. Help would be greatly appreciated.
slider

you need to create a database class. This class provides services supported by database.
class Database {
public void verifyLogin() throws UserUnknown, LoginInvalid;
...other serices...
I am sure you have a login button. The button need to add an actionlistener, MyGuiListener...
class MyGuiListener implements ActionListener {
public void actonPerformed(ActionEvent ae) {
database.verifyLogin(usr,pwd);
This is a class that implements an actionlistener inteface. Once an action is generated, the listener actionPerformed method is called. The method should use the database object to verifyLogin(String UserName, String password);

Similar Messages

  • Error message when I run searches on my website (PHP/MySQL help)

    Hey guys, can someone tell me why this is happening in my PHP? I run a search on my website and get this error message ye sI filled the hostname, username and password)
    Results for
    PHP Error Message
    Warning:  mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/a8295382/public_html/Search Results.php on line 233
    Couldn't execute query
    Here is my PHP code:
    <?php
    $hostname_logon = "host" ;
    $database_logon = "hostname" ;
    $username_logon = username" ;
    $password_logon = "password" ;
    //open database connection
    $connections = mysql_connect($hostname_logon, $username_logon, $password_logon) or die ( "Unabale to connect to the database" );
    //select database
    mysql_select_db($database_logon) or die ( "Unable to select database!" );
    //specify how many results to display per page
    $limit = 15;
    //get the search variable from URL
    $var = mysql_real_escape_string(@$_REQUEST['q']);
    //get pagination
    $s = mysql_real_escape_string($_REQUEST['s']);
    //set keyword character limit
    if(strlen($var) < 3){
        $resultmsg =  "<p>Search Error</p><p>Keywords with less then three characters are omitted...</p>" ;
    //trim whitespace from the stored variable
    $trimmed = trim($var);
    $trimmed1 = trim($var);
    //separate key-phrases into keywords
    $trimmed_array = explode(" ",$trimmed);
    $trimmed_array1 = explode(" ",$trimmed1);
    // check for an empty string and display a message.
    if ($trimmed == "") {
        $resultmsg =  "<p>Search Error</p><p>Please enter a search...</p>" ;
    // check for a search parameter
    if (!isset($var)){
        $resultmsg =  "<p>Search Error</p><p>We don't seem to have a search parameter! </p>" ;
    // Build SQL Query for each keyword entered
    foreach ($trimmed_array as $trimm){
    // EDIT HERE and specify your table and field names for the SQL query
    // MySQL "MATCH" is used for full-text searching. Please visit mysql for details.
    $query = "SELECT * , MATCH (field1, field2) AGAINST ('".$trimm."') AS score FROM table_name WHERE MATCH (field1, field2) AGAINST ('+".$trimm."') ORDER BY score DESC";
    // Execute the query to  get number of rows that contain search kewords
    $numresults=mysql_query ($query);
    $row_num_links_main =mysql_num_rows ($numresults);
    //If MATCH query doesn't return any results due to how it works do a search using LIKE
    if($row_num_links_main < 1){
        $query = "SELECT * FROM table_name WHERE field1 LIKE '%$trimm%' OR field2 LIKE '%$trimm%'  ORDER BY field3 DESC";
        $numresults=mysql_query ($query);
        $row_num_links_main1 =mysql_num_rows ($numresults);
    // next determine if 's' has been passed to script, if not use 0.
    // 's' is a variable that gets set as we navigate the search result pages.
    if (empty($s)) {
         $s=0;
      // now let's get results.
      $query .= " LIMIT $s,$limit" ;
      $numresults = mysql_query ($query) or die ( "Couldn't execute query" );
      $row= mysql_fetch_array ($numresults);
      //store record id of every item that contains the keyword in the array we need to do this to avoid display of duplicate search result.
      do{
          $adid_array[] = $row[ 'field_id' ];
      }while( $row= mysql_fetch_array($numresults));
    } //end foreach
    //Display a message if no results found
    if($row_num_links_main == 0 && $row_num_links_main1 == 0){
        $resultmsg = "<p>Search results for: ". $trimmed."</p><p>Sorry, your search returned zero results</p>" ;
    //delete duplicate record id's from the array. To do this we will use array_unique function
    $tmparr = array_unique($adid_array);
    $i=0;
    foreach ($tmparr as $v) {
       $newarr[$i] = $v;
       $i++;
    //total result
    $row_num_links_main = $row_num_links_main + $row_num_links_main1;
    // now you can display the results returned. But first we will display the search form on the top of the page
    echo '<form action="search.php" method="get">
            <div>
            <input name="q" type="text" value="'.$q.'">
            <input name="search" type="submit" value="Search">
            </div>
    </form>';
    // display an error or, what the person searched
    if( isset ($resultmsg)){
        echo $resultmsg;
    }else{
        echo "<p>Search results for: <strong>" . $var."</strong></p>";
        foreach($newarr as $value){
        // EDIT HERE and specify your table and field unique ID for the SQL query
        $query_value = "SELECT * FROM newsight_articles WHERE field_id = '".$value."'";
        $num_value=mysql_query ($query_value);
        $row_linkcat= mysql_fetch_array ($num_value);
        $row_num_links= mysql_num_rows ($num_value);
        //create summary of the long text. For example if the field2 is your full text grab only first 130 characters of it for the result
        $introcontent = strip_tags($row_linkcat[ 'field2']);
        $introcontent = substr($introcontent, 0, 130)."...";
        //now let's make the keywods bold. To do that we will use preg_replace function.
        //Replace field
          $title = preg_replace ( "'($var)'si" , "<strong>\\1</strong>" , $row_linkcat[ 'field1' ] );
          $desc = preg_replace ( "'($var)'si" , "<strong>\\1</strong>" , $introcontent);
          $link = preg_replace ( "'($var)'si" , "<strong>\\1</strong>" ,  $row_linkcat[ 'field3' ]  );
            foreach($trimmed_array as $trimm){
                if($trimm != 'b' ){
                    $title = preg_replace( "'($trimm)'si" ,  "<strong>\\1</strong>" , $title);
                    $desc = preg_replace( "'($trimm)'si" , "<strong>\\1</strong>" , $desc);
                    $link = preg_replace( "'($trimm)'si" ,  "<strong>\\1</strong>" , $link);
                 }//end highlight
            }//end foreach $trimmed_array
            //format and display search results
                echo '<div class="search-result">';
                    echo '<div class="search-title">'.$title.'</div>';
                    echo '<div class="search-text">';
                        echo $desc;
                    echo '</div>';
                    echo '<div class="search-link">';
                    echo $link;
                    echo '</div>';
                echo '</div>';
        }  //end foreach $newarr
        if($row_num_links_main > $limit){
        // next we need to do the links to other search result pages
            if ($s >=1) { // do not display previous link if 's' is '0'
                $prevs=($s-$limit);
                echo '<div class="search_previous"><a href="'.$PHP_SELF.'?s='.$prevs.'&q='.$var.'">Previous</a>
                </div>';
        // check to see if last page
            $slimit =$s+$limit;
            if (!($slimit >= $row_num_links_main) && $row_num_links_main!=1) {
                // not last page so display next link
                $n=$s+$limit;
                echo '<div  class="search_next"><a href="'.$PHP_SELF.'?s='.$n.'&q='.$var.'">Next</a>
                </div>';
        }//end if $row_num_links_main > $limit
    }//end if search result
    ?>
    Anyone got any ideas as to why this is happening?
    Also, I have not created any tables in my database... is this why it doesn't display any search results from my website?

    Sorry, but it doesn't help JTANNA.
    What is your definition of "more efficiently"? If it's limitation of search results, branded search, and limitation of styling your results then google search is more efficient. Real developers rely on their own developments. For example: how can google search display results from a password-protected site? They can't.
    best,
    Shocker

  • Apache2, PHP, MySQL Help

    Hi,
    Sorry if this is a bit of a newbie thing todo but I am not too good with solaris configuration yet.
    Can anyone supply a decent step by step and easy tutorial/how-to on how to set up Apache, PHP, MySQL and PHPmyadmin on a SPARC solaris 10 box please...
    Thanks Rob

    Can anyone supply a decent step by step and easy
    tutorial/how-to on how to set up Apache, PHP, MySQL
    and PHPmyadmin on a SPARC solaris 10 box please...Setting up Apache is very easy since all it takes is setting it up. Its installed by default, you can check /etc/apache for an example configuration file. Next to that www.apache.org/docs/ is also a very valuable read.
    <blunt SPAM>
    You could also consider looking into the Java webserver (formely SunONE). Its currently being made available for free with the Java Enterprise System and compares very well to Apache. If you'll also be doing some Java it would be a better choice (IMO its a better choice than Tomcat) and it can also do PHP.
    http://www.sun.com/software/products/web_srvr/home_web_srvr.xml
    http://www.zend.com/sun/?article=/sun/index.php&kind=&id=6179&open=1&anc=0&view=1
    http://www.php.net/
    </SPAM>
    As you'll note I included the PHP website because with the above setup you'd also need to manually setup PHP. If you have the companion CD present you can install the PHP module which will end up on /opt/sfw/apache. This directory will also present you a php.ini example which will need to be placed in /etc/apache as well. Setting it up is basicly following the documentation in the ini file, and the Apache documentation on adding an extra module (/opt/sfw/apache/libexec/libphp4.so).
    MySQL. Also very easy since its shipped with Solaris as well. Look into /etc/sfw/mysql for a README which covers the most essential steps to set it up. In short you'll need to setup a few directories for MySQL to work and optionally (but recommended) copy the default config file to /etc (/etc/my.cnf) which will define certain basic settings. The readme explains. Next you're likely to need the MySQL guide (if you're new with MySQL) which can be located at http://dev.mysql.com/doc/refman/4.1/en/index.html.
    This applies to the version (close enough anyway) which is shipped with Solaris. From personal experience I can say that MySQL 5 will also run very well on Solaris 10.
    Finally the PHPMyadmin... That really is an RTFM issue, once you have your environment setup (Apache and the likes) its likely you only need to copy it to your document root and point your browser to it.
    Hopes this helps somewhat.

  • PHP/MySQL Help Needed

    I'm a beginner with this PHP/MySQL language, but I'm using
    Dreamweaver CS3 to help things along. I've set up my database with
    my host (using PHPmyAdmin) and put in a table with some fields.
    Then I went into Dreamweaver and set up everything and it saw the
    database name perfectly. Then I made a recordset and it saw the
    fields just fine. I then made an input page to put the data into
    the database and that went off without a hitch. I then made a basic
    webpage with nothing but the call to display 2 of the fields in my
    database (I did the test in dreamweaver and it saw all the data I
    populated my database with perfectly). I then told it to preview in
    Firefox and got a blank page... Ok I must have done something
    wrong, so I put in some basic text just so I could see if even that
    would show up correctly. Then I previewed in Firefox again and not
    only did it show up, but the 2 fields showed up as well! Yea! So I
    made some changes to the fields I wanted to show and again did a
    Preview in Firefox. I was again treated to a blank page. Not even
    my basic text was showing up. I went back to Dreamweaver and added
    some more text... preview... works perfectly showing everything. I
    refresh the page and it's blank. I close Firefox and preview again.
    It's a blank page, but for the heck of it I decide to View Source
    and lo and behold all the data is there. I close the source and try
    reloading the page... blank. I'm at a loss. Any idea why this might
    be happening?

    jays99 wrote:
    > Thanks, David. I have your PHP5-Flash 8 book and egerly
    await your newest. I
    > installerd MySQL 5.027 for 10.4 intel which but it does
    not come up
    > automatically and there is no MySQL control on the
    Preferences. I read
    > somewhere that I have to open a file and change some
    lines of code in a config.
    > file. Do you have any insight to that? Thanks again, Jay
    Sorry, I haven't tested anything on an Intel Mac yet. Testing
    everything
    on Vista for my new Dreamweaver book has given me enough of a
    headache.
    However, I'm pretty sure that my editor has an Intel Mac, and
    he
    followed the instructions in "PHP Solutions" without any
    major hiccups.
    (They're pretty much the same as in the Flash book.)
    Isn't there a MySQL.prefPane icon in the MySQL installation
    package? I
    have found that MySQL won't start automatically on 10.4 (it
    did on
    10.3), but as long as you install the prefPane, you should be
    able to go
    in and start it manually.
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Float values in mysql. help appreciated.

    Hi all,
    I have a mysql db table where a few of the fields are of type 'float unsigned'.
    When inserting large values into these fields (I am using statement.setDouble()), mysql seems to convert the values to the form 1e+0x,
    for example 1,000,000 to 1e+06
    2,000,000 to 2e+06.
    I dont have a problem with this but when I am retrieving these values at a later stage (using getDouble) the db is giving them in the converted form, and as a result my jsp page is displaying them in this form which is undesirable. Is there a way in java to parse these values or convert them back?
    Thanks for the help.

    If you want to control number formatting, use
    java.text.DecimalFormatWhat part of this simple statement don't you understand! Without writing your own formatting routines the only way to format your number the way you want is using java.text.DecimalFormat.
    >
    I appreciate what you're saying, You obviously don't!
    but i am certain
    that the double values I am working with are not
    being formatted, changed to strings, or being printed
    using println. the values are being displayed on a
    jsp page using getters which return doubles. So you have an implict formating in the JSP that you don't like! Use DecimalFormat.
    The
    doubles have been assigned using
    statement.getDouble().
    Everything works fine for numbers up 9,999,999.0, but
    any number greater than that, ie 10 million or
    higher, is returned from the mysql db in the form
    1e+0xNo they are not! They are returned as IEEE format numbers.
    ex 9,999,999.0 is returned by msql as 1e+08. any
    ideas?Yes, look at DecimalFormat again and then again.

  • Dreamweaver newbie - php & mysql help

    hi,
    new to dremweaver, have used .net in past with vwd and found it straight forward to drag over grid view etc to view data from sql database.
    i want to use php and mysql now and looking at dreameaver cs4 i really want to know what each navigation is. i.e. how do i create my mysql database and drag say a grid view in dreamweaver cs4 over to view?
    basically just need to know the basics navigation of what buttons i need for to interact using php and mysql?
    any help would be great, and also if anyone can recommend a good book on php/mysql with dreamweaver cs4 as a by the by then would greatly appreciate it.
    many thanks
    andy

    Take a look at this book:
    http://www.amazon.com/Essential-Guide-Dreamweaver-Ajax-Essentials/dp/1430216107
    I didn't read it, but I am currently reading the author's another book (David Powers: PHP Object-Oriented Solutions) and he is good.
    David is also a community expert on these forums.

  • DataGrid + .PHP + mySQL Help

    I have searched all over for information on how to load data
    from mySQL in a DataGrid with AS3.
    My mySQL database only has three fields; ID, Name, Kind
    Thanks in advance for your help.

    http://www.flash-db.com/Tutorials/helloAS3/helloAS3.php?page=1
    This is a pretty good, start-to-finish, example of how to get
    data from MySQL/PHP (as well as working with other forms of data)
    to Flash AS3 and how to manipulate it. Now,...I don't think it
    covers DataGrid, but you can probably read through it and get a
    good idea of what to do. If you still have questions, after you
    read it, post back here.

  • Leopard MySQL help

    Hi Folks,
    After upgrading to Mac OSX 10.5 (Leopard) I discovered I
    could no longer connect to MySql. I immediately searched the web
    for a fix and found a few different posts offering solutions. No
    doubt due to my own lack of knowledge the terminal on the other
    'black arts' I was encouraged to delve into along the way, every
    post I followed failed to solve my problem.
    I'm sure it's all messed up behind the scenes now as I've
    dipped into all kinds of things trying to fix MySQL. The result is
    that when I try to connect through Cocoa MySql which was my tool of
    choice on OSX10.4 I get the following message:
    "Unable to connect to host localhost.
    Be sure that the address is correct and that you have the
    necessary privileges.
    MySQL said: Can't connect to local MySQL server through
    socket '/private/tmp/mysql.sock' (2)"
    I even tried MAMP which seemed to connect through PHPMyAdmin
    on the first try but following that I get this message:
    " #2002 - The server is not responding (or the local MySQL
    server's socket is not correctly configured) "
    I hate to ask but I really have tried everything over the
    past month (over and over again) and I seem to have run out of
    options. Does anyone has the time to help me find a solution?
    Cheers
    Dave

    davecheet wrote:
    > Hi Folks,
    >
    > After upgrading to Mac OSX 10.5 (Leopard) I discovered I
    could no longer
    > connect to MySql. I immediately searched the web for a
    fix and found a few
    > different posts offering solutions. No doubt due to my
    own lack of knowledge
    > the terminal on the other 'black arts' I was encouraged
    to delve into along the
    > way, every post I followed failed to solve my problem.
    > I'm sure it's all messed up behind the scenes now as
    I've dipped into all
    > kinds of things trying to fix MySQL. The result is that
    when I try to connect
    > through Cocoa MySql which was my tool of choice on
    OSX10.4 I get the following
    > message:
    > "Unable to connect to host localhost.
    > Be sure that the address is correct and that you have
    the necessary privileges.
    > MySQL said: Can't connect to local MySQL server through
    socket
    > '/private/tmp/mysql.sock' (2)"
    >
    > I even tried MAMP which seemed to connect through
    PHPMyAdmin on the first try
    > but following that I get this message:
    > " #2002 - The server is not responding (or the local
    MySQL server's socket is
    > not correctly configured) "
    >
    > I hate to ask but I really have tried everything over
    the past month (over and
    > over again) and I seem to have run out of options. Does
    anyone has the time to
    > help me find a solution?
    >
    "mysql.sock" may be missing or in the wrong directory:
    http://forum.mamboserver.com/showthread.php?t=70766
    Or per Dave Powers:
    Try this in Terminal:
    ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock
    Mick

  • Macromedia Dreamweaver "Unidentified Error" PHP MySQL, help please

    Ok,
    I've been developing web applications with with PHP/MySQL for some time now, but had been unable to afford dreamweaver to help me out. Thus every website I made came from strait "notepad" style typeing. Everything always worked just fine. Recently though I got my hands on Macromedia Studio MX, but have been having troubles ever since then.
    I wrote my own PHP script to connect to my MySQL database on my computer (localhost), and it worked like a charm. Then I went over to dreamweaver, followed all the steps, entered the information, clicked the "test" button and I get the an error "an unidentified error occured".
    At this point I checked everything tried again, and then that rendered the same result, I went online and found the same problem at Macromedia's webstie: http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_16515
    I've tried everything mentioned there to no avail. I was hopeing someone out there would know what is wrong with my connection. Quick summary:
    Trying to connect with Dreamweaver to localhost MySQL database, with PHP MySQL settings. I get "an unidentified error occured". But the informaiton has been verified as correct with my own PHP script.

    Sorry, but it doesn't help JTANNA.
    What is your definition of "more efficiently"? If it's limitation of search results, branded search, and limitation of styling your results then google search is more efficient. Real developers rely on their own developments. For example: how can google search display results from a password-protected site? They can't.
    best,
    Shocker

  • JSP - MYSQL HELP

    HI,
    Im trying to create a JSP which connects to a mysql database.
    I have downloaded all the connectivity drivers and dont know what to do from this stage.
    I have heard people talking about tomcat and apache but was wondering if i need them?
    Im new to all this connectivity bit so this is why i need help!!
    If anyone has any good links to some good jsp/mysql tutorials, please share!!!
    Thanks a lot

    You need a servlet/JSP engine, to start. You can't write or deploy a JSP without a servlet/JSP engine. Apache Tomcat is a good one to start with. It's free and robust:
    http://jakarta.apache.org/tomcat
    Here's a tutorial to get you started with servlets/JSP:
    http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/
    Do a Google search or look at the Sun tutorials if you want more. - MOD

  • Ruby on Rails  MySql Help

    I am trying to work through installing Ruby on rails on my Mac with help from a developer mate and some apple articles. However I want to check something before I go any further. I am running PHP 5 and MySQL 4.13 on my OS x, The MySQL that I currently have is from the MySQL site and not apple optimised.
    what is the best way to upgrade to Apple optimised MySQL 5? Do I remove my current MySQL version completely ( i don't have any important info in there currently) or do I look for an upgrade option?
    Can anyone help me with the shell commands for updating or removing the MySQL?

    okay, that helped. Here's what I get:
    erik-petersons-computer:/usr/local/mysql/bin erikpeterson$ ls
    comp_err mysql_zap
    makesharedlibdistribution mysqlaccess
    makewin_bindist mysqlaccess.conf
    makewin_srcdistribution mysqladmin
    msql2mysql mysqlbinlog
    myprintdefaults mysqlbug
    myisam_ftdump mysqlcheck
    myisamchk mysqld
    myisamlog mysqld_multi
    myisampack mysqld_safe
    mysql mysqldump
    mysqlclienttest mysqldumpslow
    mysql_config mysqlhotcopy
    mysqlconvert_tableformat mysqlimport
    mysqlcreate_systemtables mysqlmanager
    mysqlexplainlog mysqlshow
    mysqlfindrows mysqltest
    mysqlfixextensions mysqltestmanager
    mysqlfix_privilegetables mysqltestmanager-pwgen
    mysqlsecureinstallation mysqltestmanagerc
    mysql_setpermission perror
    mysql_tableinfo replace
    mysqltzinfo_tosql resolvestackdump
    mysql_upgrade resolveip
    mysqlupgradeshell safe_mysqld
    mysql_waitpid
    erik-petersons-computer:/usr/local/mysql/bin erikpeterson$
    How would I create a new database from here?

  • Applet connection to remote MySql - HELP

    Hi:
    I've got an applet that connects to a MySql database (4.1).
    As long as I try to connect to the MySql server on the machine the applet is running on (my development computer), everything works great.
    I'm using this jar as the MySql connector:
    mysql-connector-java-5.0.3-bin.jar
    I can connect to the remote MySql server (also 4.1) with MySql Administrator and also with .NET, no problem.
    BUT - when I try to connect to the remote MySql server from the Applet I get an 'access denied' error.
    I also tried it from the applet set up as a Java application with a main function. If I try to connect to the local MySql server, no problem. If I try to connect to the remote machine I get a 'connection timeout' error.
    I should add that when I connect to the remote machine from MySql Administrator, the connection is almost instantaneous and with no problem.
    Any help would be greatly appreciated.

    Well, I've been over it and over it. I've read and tried everything I could find.
    No matter what I do it won't connect.
    The applet is signed, I don't need to learn how to do that.
    The popup comes up and asks if I want to run it: I click YES
    The connection works fine for the local database but not the remote one.
    Again, I can connect to the remote one with MySql Admin just fine using the same parameters.
    import java.*;
    import java.sql.*;
    import java.util.*;
    import java.security.*;
    public class DBaseConn extends java.applet.Applet {
        private java.sql.Connection  oCn = null;   
        private final String MySqlUrl = "jdbc:mysql://555.555.555.555:3306/mysql";
        private final String MySqlserverName= "555.555.555.555";
        private final String MySqlportNumber = "3306";
        private final String MySqldatabaseName= "mysql";
        private final String MySqluserName = "SomeUser";
        private final String MySqlpassword = "SomePassword";
        private final String selectMethod = "cursor";
        public String sErr = "";
        public void init() {
            // TODO start asynchronous download of heavy resources
        public java.sql.Connection OpenMySqlDBase() throws Exception
           try
                Class.forName("com.mysql.jdbc.Driver");
                //oCn =  DriverManager.getConnection(MySqlUrl, MySqluserName, MySqlpassword);
                oCn = (Connection)AccessController.doPrivileged(new PrivilegedAction() {
                    public Object run()
                        try
                            return DriverManager.getConnection(MySqlUrl, MySqluserName, MySqlpassword);                       
                        catch(Exception exp)
                            sErr = exp.getMessage();
                            return null;
                if(oCn!=null)
                    sErr = "MySQL Connection SUCCEEDED!!";
                    return oCn;
                else
                    if(!sErr.equals(""))
                        sErr = "MySQL Connection FAILED with ERROR: " + sErr;
                    else
                    sErr = "MySQL Connection FAILED!";
                    return null;
           catch(Exception exp)
               sErr = "MySQL Connection FAILED With ERROR!:\r\n" + exp.getMessage();
               return null;
    }The error is:
    Communications link failure due to underlying exception:
    ** BEGIN NESTED EXCEPTION **
    java.net.SocketException
    MESSAGE: java.security.AccessControlException: access denied (java.net.SocketPermission 555.555.555.555:3306 connect,resolve)
    STACKTRACE:
    , , ,

  • Dreamweaver adding local testing server MySQL-HELP REQUEST

    I have a website on register.com and I am using MySQL for the
    first time. My DB and table have been created using MyPHPAdmin. Now
    I want to use my Dreamweaver to setup a testing server that will be
    local and then upload asp pages after testing. Can Anyone PLEASE
    assist with this. I have downloaded and installed MySQL 5 and
    loaded the MySQL Driver for ODBC. I am not sure if I am doing this
    correctly OR if anyone knows an easier way. In summary I simply
    want to:
    A : Be able to test MySQL tables using dreamweaver's testing
    server then locally upload to my remote site that is hosted at
    register.com.
    THANKS in advance
    Mark

    Why not use PHPMyAdmin to build the database remotely and
    then just use your
    remote connection for testing?
    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
    ==================
    "Mark6372" <[email protected]> wrote in
    message
    news:eivg19$sdf$[email protected]..
    >I have a website on register.com and I am using MySQL for
    the first time.
    >My DB
    > and table have been created using MyPHPAdmin. Now I want
    to use my
    > Dreamweaver
    > to setup a testing server that will be local and then
    upload asp pages
    > after
    > testing. Can Anyone PLEASE assist with this. I have
    downloaded and
    > installed
    > MySQL 5 and loaded the MySQL Driver for ODBC. I am not
    sure if I am doing
    > this
    > correctly OR if anyone knows an easier way. In summary I
    simply want to:
    >
    > A : Be able to test MySQL tables using dreamweaver's
    testing server then
    > locally upload to my remote site that is hosted at
    register.com.
    >
    > THANKS in advance
    > Mark
    >

  • Servlet mySQL help needed

    Hey Guys... I have a servlet located on the same server as my mySQL database, which is supposed to gather data from the database. Then I have client code, which is supposed to connect to the servlet from some other remote machine, and get the data from the servlet. I had to do it this way because my webhost does not allow remote access to the mySQL database. But my servlet code is not working, no data is being gathered. And I'm betting my client code is incorrect too. I've never had to connect to a servlet from a remote app, I've always connected directly to the database...sooo could you check my code and show me what is wrong and how to do it correctly? (note I XXX'ed out passwords, etc) Thank you...
    LOCAL SERVLET
    public class ServletTest extends HttpServlet
         public void doGet(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException
             response.setContentType("text/html");
              PrintWriter out = response.getWriter();
             Connection myConnection;
            Statement myStatement;
            String url="jdbc:mysql://localhost/tsptracker_com?user=XXX&password=XXX";
            String query = "SELECT * FROM fund_data ORDER BY datadate DESC LIMIT 2";
            try { Class.forName("org.gjt.mm.mysql.Driver").newInstance(); }
            catch (Exception e)
            { System.err.print("Unable to load driver"); }
            try
                myConnection = DriverManager.getConnection (url, XXX, XXX);
                myStatement = myConnection.createStatement();
                ResultSet rs = myStatement.executeQuery(query);
                for(int i = 0; i < 4; i++)
                      int id = rs.getInt("dataID");
                      String dataDate = rs.getString("datadate");
                      double gPrice = rs.getDouble("g_price");
                      double fPrice = rs.getDouble("f_price");
                      double cPrice = rs.getDouble("c_price");
                      double sPrice = rs.getDouble("s_price");
                      double iPrice = rs.getDouble("i_price");
                      String temp = id + " " + dataDate + " " + gPrice + " " +
                           fPrice + " " + cPrice + " " + sPrice + " " + iPrice;
                     out.println(temp);
                myStatement.close();
                myConnection.close();
            catch(SQLException e)
            { System.err.println(e.getMessage()); }
            out.close();
    }REMOTE CLIENT
    public class ClientTest
         public static void main(String[] args) throws Exception
              URL url = new URL("http://www.XXX.com/servlet/Test");
              URLConnection con = url.openConnection();
              con.setDoOutput(false);
              con.setDoInput(true);
              con.setUseCaches(false);
              InputStream in = con.getInputStream();
              String buffer = "";
              for(int i = in.read(); i != -1; i = in.read())
            { buffer += (char)i; }
              in.close();
              System.out.println(buffer + "");
    }

    Hello kkopacz,
    From your code, some of the assumptions seems to appear :
    1) You are having Your Servlet Container and MySql on the same machine.
    2) You are providing your user name and password in your URL for the MySql Driver.
    3) You have mapped the 'ServletTest' class's object by '/servlet/Test' in your Deployment
    Descriptor(web.xml).
    4) You are assuming at least four records in your MySql database : tsptracker_com [ This should be in fact in your while(rs.next()) loop at least though not checked for rs to be null ]
    I would say, try with following changes in your code,
    1) insted of 'myConnection = DriverManager.getConnection (url, XXX, XXX);' in ServletTest
    only say 'myConnection = DriverManager.getConnection (url)', since you are already giving as a part of dbase URL , uname and pwd.
    2) In your ClientTest, try following code
    public class ClientTest
         public static void main(String[] args) throws Exception
              URL url = new URL("http://www.XXX.com/servlet/Test");
    // Since http URL and also set content type in response test/html,
    // U can use HttpURLConnection object.
              HttpURLConnection con = (HttpURLConnection) url.openConnection();
    if(con.getContentLength() == -1) {
    con.connect();
              InputStream in = con.getInputStream();
              String buffer = "";
              for(int i = in.read(); i != -1; i = in.read()) {
    buffer += (char)i;
              in.close();
              System.out.println(buffer + "");
    I hope this should work fine.
    Main prob seems to be in your code, is you are giving unmae and paswd again.. and assumption of recod numbers.
    Anyway, I think this should work for you.
    Cheers
    -Yogi

  • Creating A Report need PHP MYSQl HElP

    I have a table "officers" table two with 4 fields all with
    variable char which will end up just being names. However, I need
    to create a report that counts each the occurance of each name and
    ouputs the name with the count next to it. The names in table
    "officers" are concatinated from a first name field and last name
    field in a separate table "persons";
    I need some help figuring out how to write this using
    PHP.

    Hi Shashank,
    SQL Server Reporting Services provides a full range of ready-to-use tools and services to help us create, deploy, and manage reports for our organization, as well as programming features that enable us to extend and customize our reporting functionality.
    With Reporting Services, we can create interactive, tabular, graphical, or free-form reports from relational, multidimensional, or XML-based data sources. To create a basic table report, we can refer to the tutorial as below:
    http://msdn.microsoft.com/en-IN/library/ms167305(v=sql.110).aspx
    For more information and tutorials about Reporting Services, please refer to the following documents:
    Reporting Services (SSRS)
    Reporting Services Tutorials (SSRS)
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

Maybe you are looking for

  • ITunes consistently crashing

    My iTunes will open and crash shortly there after. itunes is the latest version, even after a repair, then a full re-instalation. Tried the ".dll" fix. I am at a loss. Please internet, you're my only hope. Running on Windows 7 64bit.

  • Norton Security Warning

    On Friday,Saturday and Sunday when opening my lap top I received an Error warning from Norton.  After 5 minutes they confirmed a fix for the problem and all was well. Tonight I had the same message but this time no fix.  I was advised to run the Nort

  • Breaking audiobooks into tracks

    I have downloaded books from audible.co.uk via iTunes onto an iPod shuffle. But if I lose my place, I cannot scan through to find where I was, because the whole book is seen as one track. Is there any way of sectoring the book? eMac   Mac OS X (10.3.

  • Wrong result for decimal in currency

    Hi All, I loaded the history data by pc_file to the bw systems and when ı check the data in the infocube and in the source file, they are same. But when ı executed the report, for example the value of the keyfigure in the cube and source file is 118,

  • RTF text with background colour - formatting lost in editable RTF export

    Hi I have designed a report in CR2008 using XSD datasource. I have a field which returns a RTF text. The text comes out correctly when I run the report.  Scenario: 1.Background colour (eg Yellow) has been applied to the field 2.RTF text contains para