Java & MySQL in linux

Hi,
i installed Mandrake Linux and clicked for it to install MySQL when installed. how do i enter records and create a mysql database? what do i click on to start it? do i use telnet or shell, what do i type in? how do i call a mysql data base from a java program? (i can get it to work in windows, but just installed linux today.
eat lot of turkey,
L

i tried running
shell> rpm -qpl MySQL-VERSION.i386.rpm
but got the error error: open of MySQL-VERSION.i386.rpm failed: No such file or directory
but when i type
whereis mysqli get
/usr/bin/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.bz2
does that mean its already installed, is there a readme file or something similar?
ty
abe

Similar Messages

  • Java running under linux with crontab

    I'm having a problem:
    i want to run a java program under linux with crontab.
    my classes are in a directory and aren't in a package. i run em by invoking ./start which is a small script that i wrote. The script is in the same dir as the classes and invokes java by "java Main >>logjava.txt " but this doesn't seem to work all i get is an empty logfile
    i need to run the program every day at 0800 so i inserted the following in crontab:
    0 8 * 1-5 /var/"path"/start > logjava (where path is the path to the classes dir)
    if i run the cmdline from anywhere on the prompt i get the result i want. I think it's because the cron runs it from the root dir thus making java unable to find the classes
    Any suggestions would be welcome. or can some1 tell me how to make linux executables from the java (i usually use jsmooth for the windows exe)

    You can execute several commands in the process started by cron. You separate them using semicolons.
    Have you tried a cron entry like this:
    0 8 * 1-5 cd /var/"path";pwd;echo $PATH; ./start > logjavaOr, you may need to make sure the process started by cron gets the same environment as your interactive shells do, by explicitly loading your setup or .login scripts:
    0 8 * 1-5 . $HOME/.setup;cd /var/"path";pwd;echo $PATH; ./start > logjava

  • Java mysql OK with Terminal but not OK with Apache local web server

    With terminal I have :
    CLASSPATH=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Classes/:/Library/Java/Extensions/:./
    SUDO_GID=20
    SECURITYSESSIONID=210800
    _=/usr/bin/printenv
    127:/Library/WebServer/Documents/Java root# java TestMySQL
    2006-05-21 13:39:00.0 ************************************************** = OK
    127:/Library/WebServer/Documents/Java root#
    import java.sql.*;
    * mysql-connector-java-3.1.12-bin.jar
    *   % javac /Library/WebServer/Documents/Java/TestMySQL.java
    *   % java TestMySQL
    public class TestMySQL {
            public static void main(String argv[]) throws Exception {
                    // Load the driver class
                    Class.forName("org.gjt.mm.mysql.Driver");
    1                //Class theClass = null;
    2               //try {
    3                //    theClass = Thread.currentThread().getContextClassLoader().loadClass("org.gjt.mm.mysql.Driver");
    4                //}
    5                //catch (ClassNotFoundException e) {
    6                //    theClass = getClass().getClassLoader().loadClass("org.gjt.mm.mysql.Driver");
    7                //}
                    Connection conn = DriverManager.getConnection(
                            "jdbc:mysql:///test",
                    Statement stmt = conn.createStatement();
                    ResultSet rset = stmt.executeQuery("SELECT now();");
                    while (rset.next()) {
                            System.out.println(rset.getString(1));
                    // Close result set, statement and DB connection
                    rset.close();
                    stmt.close();
                    conn.close();
    }I have a simple TestMySQL.html file with applet TestMySQL.class in it.
    Nothing but "Applet TestMySQL not inited"
    When I uncomment the try/catch lines (lines 1 to 7) , java compiler generate an error... near getClass().getClassLoader().loadClass("org.gjt.mm.mysql.Driver");
    With "Class.forName("org.gjt.mm.mysql.Driver");" no problem.
    Running MacOS X 10.3.9, Apache/1.3.33 (Darwin) PHP/4.4.1 mod_ssl/2.8.24 OpenSSL/0.9.7i and JVM 1.4.2_09
    Thanks for help.
    P.S. This my first approach to java/mysql but I would like to see this short program running on my local web server ...
    Thanks.

    hi :-)
    can you post the stack trace?
    im not sure what is causing the error because of less info,
    but have you tried to copy the driver of mysql to tomcat lib folder?
    regards,

  • How to do transactions in jsp pages using Java & MySQL ?

    Hi,
    I'm a newbie..
    I'd like to know "How to do transactions in jsp pages using Java & MySQL ?"
    Platform: Windows XP, Apache Tomcat 5.5, MySQL 5, Java bean without EJB
    what are the the different types of transactions? Differences between them?Pls provide examples?
    Which among them is the best method to implement a transaction?
    Pls help me...
    thnx in advance...

    http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html

  • Java editor for Linux

    Which is the best java editor for Linux ??
    in the Win plataform I'm using the JCreator ... and now I'm migrating to the linux plataform...
    please tell me the name of the editor you are using if you use Linux... (Red Hat 7.1 here...)

    you can try SciTE from http://www.scintilla.org - it's simple, fast and good enough. you can work with java, c and many other programming languages. There are some features that don't present in any other editor.
    Btw SciTE is only editor, not complete IDE. If you wish a full IDE with projects.. etc you can use Borland's JBuilder

  • Java Editor in Linux

    hi all,
    can someone suggest a good Java Editor for Linux? I'm currently using the BlueFish Editor and i press the DOT nothing is come out, i hope that to get an editor where the members can come out after the dot is presses. By doing this, it will minimise a lot of typing error. I had try to install the JCreator on my system, but the setup cannot run on Linux.

    u mean just copy the installation to the
    /usr/local??
    Because i dun have the root permission and the
    installation file has been downloaded at the desktopIf you don't have root permissions (and can't get them) then you probably will not be able to copy the JDK to /usr/local . You don't need the JDK to be anywhere in particular so if it is installed in your home directory then leave it there. Just make sure your 'path' is set correctly!
    To check you have it configured right, use
    java -version
    and it should report
    java version "1.5.0_06"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
    Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)

  • JDBC Java- mysql problem help!

    Hi, I wnat to connect to mySQL fromo Java, I followed all the instructions from the mySql web page, yet I havent been able to do it, when I compile the java progrm I keep getting class not found exceptions, I am using Fedora Core and Java was already installed-well I chose to install it when I installed the operating system, the point is that the paths are all assigned by he system not by me.
    WHat can I do?, Ive been trying over andover again with no results, hopefully somebody can help, I tried to include all the configuration in this email,
    thank you
    my java program is the following:
    t.java
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class t {
    public static void main (String[] args) {
    System.out.println("Hello, world!\n");
    Class.forName("com.mysql.jdbc.Driver");
    when I javac t.java
    I have the following error
    4. ERROR in t.java
    (at line 11)
    Class.forName("com.mysql.jdbc.Driver");
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    Unhandled exception type ClassNotFoundException
    when I comment out the Class.forName the hello world rogram runs fine
    when I vi /etc/java java.conf this is the result
    # System-wide Java configuration file -- sh --
    # JPackage Project [www.jpackage.org]
    # Location of jar files on the system
    JAVA_LIBDIR=/usr/share/java
    # Location of arch-specific jar files on the system
    JNI_LIBDIR=/usr/lib/java
    # Root of all JVM installations
    JVM_ROOT=/usr/lib/jvm
    # You can define a system-wide JVM root here if you're not using the default one#JAVA_HOME=$JVM_ROOT/java-gcj
    # Options to pass to the java interpreter
    JAVACMD_OPTS=
    ~
    [root@localhost test]# echo $PATH
    /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
    echo $JAVA_HOME
    it contains nothing
    ls /usr/share java*
    java
    java-1.3.0
    java-1.4.0
    java-1.4.1
    java-1.4.2
    java-1.5.0
    javadoc
    java-ext
    java-utils
    mysql-connector-java-3.1.13-bin.jar is under
    /usr/share/java
    in /etc/profile I have:
    export CLASSPATH=$CLASSPATH:/usr/share/java/mysql-connector-java-3.1.13-bin.jar
    in /root/.bash_profile i have
    CLASSPATH=/usr/share/java/mysql-connector-java-3.1.13-bin.jar:/usr/lib/java-ext/mysql-connector/mysql-connector-java-3.1.13-bin.jar
    export CLASSPATH
    when I echo $PATH i have
    /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin

    Thanks duff,
    The driver seems to be found
    when I run
    public class t {
    public static void main (String[] args) {
    try
    System.out.println("Hello, world!\n");
    Class.forName("com.mysql.jdbc.Driver");
    System.out.println("MySQL Driver Found");
    catch (ClassNotFoundException e)
    System.out.println("MySQL Driver NOT Found");
    e.printStackTrace();
    I feel somehow ive been focusing in the wrong side of the problem due to my ignorance in Java. Please help me to understand, the reson for which ithe runtime was telling me that there was an unhandled exception was because it is a requirement to handle all exceptions of this kind? why wouldnt it cmplain if I jst did the hello world without any exception handling, maybe because it is a requirement in the Class.forName...
    the other question is, is the message I was obtaining completely independent of the fact that the class was or was not found?
    Maybe, I should go with these questions to the newbies forum...
    thanks

  • Java installation under Linux

    Hi
    I've got a problem with the installation of somme Java Packages under Linux.
    What must I do with the "*.jar" file? I wont to install the neu Open Xchange Server under SuSE 9.1, but there are somme Problems with the Java Packages!
    Can someone help me???
    Thanks a lot!!
    Dambi

    Hello Ishan,
    The J2EE server is not starting because of the error in A. Please refer to note 965451 for solution.
    The warnings in part B are insignificant. The startup framework has list with profile parameters and when a parameter is not in the list complains with warning. This warning doesn't mean that the parameter is wrong!
    The jcontrol is the parent process of the server process and if the server process dies you will always get error message there.
    Regards,
    Ventsi Tsachev
    Technology Development Support (J2EE Engine)
    SAP Labs, Palo Alto, Ca (USA)

  • Java mysql connection

    Hi,
    Can anybody tell me how can I make the java-mysql JDBC connection using IDS Server ( type 3 driver )
    this is the only driver which bypass proxy/firewall
    if any one use this driver before pls give me more information about it.

    Well, first you have to obtain a type 3 driver for MySQL. I don't know if such a driver exists.
    Assuming one does, you'd need a properly configured server.
    Once you've got that, the Java code should be identical to that for any other driver.

  • Java Embedded ARM Linux edition

    I tried "Java Embedded ARM Linux edition" on "Familiar GPE 2.7".
    Magically for the 1st time, I was I able to compile a java source using GPE linux on my iPAQ h2200.
    Then I manually copy a few more libraries to test up in the device, "tools.jar" and "hsqldb.jar".
    I tried to compile and run a simple "JOptionPane.showMessageDialog()" UI object.
    I'm able to compile but failed to run it with errors below:
    "java.awt.HeadlessException ... <unknown source> ..."
    "... <unknown source>"Was Java Embedded meant to support swing object, or awt?
    Since this is an evaluation distribution (which will expired after 90 days), how do I get a full distribution?
    Thanks for any help.
    By Avatar Ng

    Yes I'm refering to "Embedded SE for Linux ARM evaluation binary", and I'm testing it on GPE Linux on my iPAQ h2200 device.
    I got following when I typed "java -version"
    I able to run and compile java in console mode, just that I didn't get my gui working ...
    The last finding I have is to run with phoneme arm distribution, crossing my fingers ... wish me luck.
    I should update the testing results ib my blog below should it be a fail or success.
    Thanks for any help!
    by Avatar Ng
    http://avatar21.superihost.com/

  • Why we have separate azure java SDK for linux and windows

    I saw different links for downloading azure java SDK for linux and windows.
    What difference does it actually have when java is platform independent? Or both are same jars?

    Hi,
    Thank you for your post.
    It contains the same jar files.
    Regards,
    Mekh.

  • Java 2SE and Linux SuSE 8.1 Prof.

    Hi,
    What do you think about relationship as in the topic, Java 2SE on Linux SuSE 8.1, does it work?
    Regards
    Krzysztof

    I do all my development work (JFreeChart, JFreeReport) using Eclipse on SuSE 8.1 Professional (Gnome desktop). I don't have any problems with it...
    Regards,
    Dave Gilbert
    http://www.object-refinery.com

  • Question about Java implementation in Linux platform

    Hello,
    I shall implement one Java program in Linux platform. I'm a newer to linux. Need I install some special software in Linux platform to compile and run JAVA program?
    Thank you in advance
    java_linux

    Sorry, this forum is about Sun Studio, which is a collection of native compilers and tools. About Java, please use Java forum; for example, one of these: http://forums.sun.com/category.jspa?categoryID=5

  • DNSDHCP Java Console for Linux usage question

    Hi All,
    This should be one of the simplest things, but it defeats me. I have downloaded and installed the DNSDHCP Java Console for Linux on my SLED11 workstation. I start it up and am presented with a login screen:
    Server Address: [ ] Port: [ 636 ]
    (e.g. 192.168.xxx.xxx)
    Username: [ ]
    (e.g. cn=admin,o=companyname)
    Password: [ ]
    [v] Use SSL
    Questions:
    Server address: is that supposed to be my OES DNS/DHCP server? Or my eDir server? I've tried each.
    Username: is that supposed to be my tree admin? I've tried it.
    Password: I think I got this one.
    SSL: I *think* my server is set up for SSL, but I'm not sure. I've tried it both ways.
    I have tried every combination except the one that works. Can anyone suggest something that I may be missing?
    Thanks,
    Toney.

    Most of the time eDir servers default to SSL, and you have to check (or uncheck) the box under the LDAP Group object to require TLS authentication (or something like that)--so if you haven't done that then non-ssl will likely not work. I have had some boxes that wont do SSL though.... In that case, non-ssl usually works for me. You can also configure the same things under iManager.

  • Running an Executable from a JAVA API in LINUX

    Hi,
    I want to run a C++ executable from my JAVA API in Linux. This is the sample of the code which i
    have used
    String[] arguments = new String[5] ;
    arguments[0] = "/usr/local/code/fun/dcmdump";
    arguments[1] = "+f";
    arguments[2] = "/usr/local/code/fun/240.dcm";
    arguments[3] = "+W";
    arguments[4] = "/usr/local/code/fun";
    Process p = Runtime.getRuntime().exec(arguments);
    On running the test file, the program seems to hang there. dcmdump is the name of my c++ executable and arguments [1] - [4] are its inputs. dcmdump should accepts these inputs and dump the contents of the file 240.dcm into the path mentioned by the last argument.
    But my program jst hangs. Is the the correct way to go about??
    Any suggestions or ideas r welcome!!
    Please let me know
    Thanks
    Dhaval

    Hi
    I did the following
    String[] cmd ={"/bin/sh","-c","/usr/local/code/fun/dcmdump","+f","/usr/local/code/fun/240.dcm","+W","/usr/local/code/fun"};
    Process p = Runtime.getRuntime().exec(cmd);
    When i execute my application, i see the following output
    [root@voltaire fun]# java TestRead2
    $dcmtk: dcmdump v3.5.3 2004-05-27 $
    dcmdump: Dump DICOM file and data set
    usage: dcmdump [options] dcmfile-in...
    parameters:
    dcmfile-in DICOM input filename to be dumped
    general options:
    I try to write the arguments in the command line when i execute but still get the same output.
    I dont think dcmdump is receving any arguements..
    Executing /bin/sh does it mean you have to mention the arguements in the command in the same manner that i have the String[] cmd??
    PLease let me know..
    Also i have put a Buffered reader to capture the output of dcmdump but I dont think i have reached my application has reached thr as yet. The code i have written is
    // put a BufferedReader on the output
    InputStream inputstream = p.getInputStream();
    InputStreamReader inputstreamreader = new InputStreamReader(inputstream);
    BufferedReader bufferedreader = new BufferedReader(inputstreamreader);
    // read the output
    String line;
    while ((line = bufferedreader.readLine()) != null) {
    System.out.println(line);
    Please let me know your suggestions/ideas.
    thanks

Maybe you are looking for