Database with Java

if i wannaa develop a system with accessing database or update , insert ,delete..
which database system shall i use for Java??
MySQL??SQL2000?Access??MSDE?
are those working fine with JAVA?

Ok, judging from your other thread saying you are new to java and all,
Begin with J2SE, this is java. Take the tutorials available from this site( see the tutorial link on the left ?)

Similar Messages

  • How to connect oracle database with JAVA

    how to connect oracle database with JAVA....
    using j2sdk and Jcreator . which connector to use .. what are the code for that ..

    PLEASE .... Ask in an Oracle Java forum.
    And read the documentaiton. There is a whole document devoted to doing that. http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/toc.htm has examples.
    PLEASE ... do not ask product questions in a forum which clearly has a title saying it is devoted to assisting with download problems.

  • How can I compact a MSAccess database with java?

    Hi.
    I have a question (Please Help!!!):
    How can I compact a MSAccess database with java-jdbc? Is it posible?
    Thanks

    MS Access database has a max length limitation of 2.14GB for Access 2000( 1.07G for Access 97), and won't recycle basically space for update/delete sql so tha it's a good idea to use MS Access database for program, which need update/delete frequent ly data. The programmers of HXTT Access(www.hxtt.net) are writing code for CREATE TABLE/DATABASE sql now. If you need a pure Java solution for PACK TABLE/DATABSE urgently in your project, you should send such a requirement to the Support page of www.hxtt.net so that they can schedule complementing such a fucntion. Otherwise, you should pack your databae manually or visit C++ code for Compact an Access Database Programmatically at
    http://www.codeguru.com/Cpp/data/mfc_database/microsoftaccess/article.php/c4327/ , or use Easy Microsoft Access MDB MDE Compactor at http://www.easyhr.com.au/software/easy_mdb_mde_compactor.htm.

  • How Connect to oracle database with java

    i have trouble with my program
    i use oracle 8i to my database and java for interface
    this mycode :
    import java.sql.*;
    class TestThinApp {
    public static void main (String args[])
    throws ClassNotFoundException, SQLException {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    // or you can use:
    // DriverManager.registerDriver(
    // new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection(
    "jdbc:oracle:thin:@dssw2k01:1521:orcl","scott","tiger");
    Statement stmt = conn.createStatement();
    ResultSet rset = stmt.executeQuery(
    "select 'Hello Thin driver tester '||USER||'!' result from dual");
    while(rset.next())
    System.out.println(rset.getString(1));
    rset.close();
    stmt.close();
    conn.close();
    i have trouble , becouse i can connect my database with java (JDK)
    if any one can help me pls?
    arif

    PLEASE .... Ask in an Oracle Java forum.
    And read the documentaiton. There is a whole document devoted to doing that. http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/toc.htm has examples.
    PLEASE ... do not ask product questions in a forum which clearly has a title saying it is devoted to assisting with download problems.

  • Is it possible to insert data into a MySQL database with Java?

    Hello everyone!
    I would like to know, if it's possible to insert data into a MySQL database, with a JFrame inside a servlet?
    When the JFrame is first created it calls this method:
         * Connects the servlet with the MySQL database.
        private void connect(){
            try{
                Class.forName("com.mysql.jdbc.Driver");
                connection = DriverManager.getConnection(
                        "jdbc:mysql://localhost:3306/data", "root", "omfg123");
            }catch(ClassNotFoundException cnfe){
                cnfe.printStackTrace();
            }catch(SQLException sqle){
                sqle.printStackTrace();
        }Then, when you click the "Add" button, it executes this code:
                add.addActionListener(new ActionListener(){
                    @Override
                    public void actionPerformed(ActionEvent ae){
                        String employee = employeeName.getText();
                        String[] args = employee.split(" ");
                        firstName = args[0];
                        lastName = args[1];
                        execute();
                });And this is my "execute()" method:
         * Connects the servlet with the MySQL database.
         * - And executes the SQL queries.
        private void execute(){
            try{
                PreparedStatement statement = connection.prepareStatement("insert" +
                        " into employees values(" + firstName + ", " + lastName
                        + ")");
                ResultSet result = statement.executeQuery();
                String fullName = firstName + " " + lastName;
                printer.write("Employee " + fullName + " added.</br>");
            }catch(SQLException sqle){
                sqle.printStackTrace();
        }But when I click the "Add" button, nothing happens.

    This is what I use to insert into mysql. It works on windows.
    try {
                Class.forName("com.mysql.jdbc.Driver");
                String connectionUrl = "jdbc:mysql://" + loadip + "/custsig?" +
                        "user=root&password=";
                Connection con = DriverManager.getConnection(connectionUrl);
                newproc = jTextField1.getText();
                newsoft = jTextField2.getText();
                newdeb = jTextField3.getText();
                newcust = jTextField4.getText();
                if (newcust.equals("")) {
                    errorsig12 = 1;
                    jLabel1.setForeground(new java.awt.Color(255, 0, 0));
                } else if (newsoft.equals("")) {
                    errorsig12 = 1;
                    jLabel2.setForeground(new java.awt.Color(0, 0, 0));
                } else if (newproc.equals("")) {
                    errorsig12 = 1;
                    jLabel3.setForeground(new java.awt.Color(0, 0, 0));
                } else if (newdeb.equals("")) {
                    errorsig12 = 1;
                    jLabel4.setForeground(new java.awt.Color(0, 0, 0));
                if (errorsig12 == 0) {
                    PreparedStatement ps = con.prepareStatement("insert into customer set cust_name = ?,  software = ?, processor = ?, debit = ?");
                    ps.setString(4, newdeb);
                    ps.setString(3, newproc);
                    ps.setString(2, newsoft);
                    ps.setString(1, newcust);
                    int rs = ps.executeUpdate();
            } catch (SQLException eg) {
                System.out.println("SQL Exception: " + eg.toString());
            } catch (ClassNotFoundException cE) {
                System.out.println("Class Not Found Exception: " + cE.toString());
            }

  • Create new oracle database with JAVA

    Hi!
    I would appreciated it if you could help me to solve a problem that i have.
    I am trying to create a new oracle database by a JAVA 1.4.2 application. I am using the scripts that Oracle 10.g supplies during the creation of a new database from the server (Generate Database Creation Scripts) with the appropriate changes, generated by a java application. Unfortunately, i am unable to connect with the database and the listener. Is there any other way to create a new database by java and how can i solve my current problem with the oracle scripts?
    Thank you.

    A) To create a new schema, you need to be connected as a user that has create schema privilege, or as tyhe user who is to own the schema (remembering that the user has appropriate create privs, as seen in the GRANT command in the SQL Reference manual). Not an issue at all, I think, if you coordinate this with your DBA. Discussed very well in the Administrator's manual.
    B) Alternately, you could create a complete copy of the schema, including all desired objects (tables, views, etc.) in a separate database and simply export the user and schema. Then simply invoke the OS-based import command (imp) to load that entire thing into the target database.
    C) To create a new database, there are 3 simple steps ...
    1) create the appropriate initialization parameter file
    the init{sid}.ora file should be placed in the $ORACLE_HOME/dbs or %ORACLE_HOME%\database directory. (I recommend you do not attempt to create the spfile.) Of critical interest will be setting the block size information, the control file parameters, and using the appropriate memory management parameters, based on the version of the software you will be using to create the database instance.
    2) start an empty instance, pointing to the parameter file
    This will be an OS specific call, and will require that you have the correct OS environment set up as well as access to the ORACLE_HOME which will provide the software that you will invoke. In *nix you will need to call the sqlplus command with sysdba provs and in Windows you will need to call oradim to initialize this as a service.
    3) run the SQL create database command
    You might want to use the dbca to create a template of the create database command, or look in the SQL Reference manual for the variations on the command. Of critical interest will be initializing the redo logs as well as the system, sysaux (if needed), temp and undo tablespaces after which you can set up the regular tablespaces, users and schemas. I highly recommend that you have redundant copies of the control files on separate drives.
    You may want to review the online Concepts manual and the Adminstration Guide for some of the specifics to your needs, but I think I've covered the basics.
    Remember that ideally you will only have one database instantiated on any given server as the memory and CPU overhead of each instance is significant.
    Good luck.

  • How to connect with Microsoft Access Database with JAVA

    I want to know the command and query to connect between MSAccess and JDBC.
    Is it beter way to make connection with MSAccess comparing with other Databases such as SQL and Oracle.
    Which Database will be the best with Java?
    I also want to know to be platform indepadent which database is suitable?

    On Windows, you can use MS Access database by:
    Set up a System Data Source using the ODBC control panel applet.
    Use the jdbc:odbc bridge JDBC driver, and specify a jdbc url that points to the data source name you just specified.
    It's been too long since I've done this, so I don't remember the syntax of the jdbc url, but I'm sure that if you do a search for the jdbc:odbc bridge that you will find what you are looking for.
    As far as the question about which database is best, you will need to determine that based on your project requirements.
    If you want a quick and dirty, open source, cross-platform database, take a look at HyperSonic SQL.
    - K

  • Programming the Oracle Database with Java and Web Services: sample chapter

    This will be the first book devoted to Java in the Oracle Database: read the sample chapter @ http://www.oracle.com/technology/books/pdfs/mensah_ch1.pdf
    This book also covers the latest Oracle JDBC, Oracle SQLJ, JPublisher and Database Web Services A brief description @
    http://www.elsevier.com/wps/find/bookdescription.cws_home/706089/description#description
    Thanks, Kuassi

    Hi Kuassi,
    Thanks for letting us know that your book is available. I have been following one of your articles about "Virtualize Your Oracle Database with Web Services". More specifically "The Database as Web Services Consumer". I think that this is an area that has in the past been under estimated as to the potential benefits.
    I am currently trying to develop a solution that consumes several interfaces with a couple of them being published web services, so an ideal solution. I have then spent the last three weeks having to read up about the architecture of Java in the database, Jpublisher and make sense of how it all works together.
    I have got very close to getting one of the web services to work but failed due to using 10gR2 where all the java & libraries has moved to version 1.5. The solution is to load the jdk1.4.2 and configure jpublisher to use this. So far so good except this is not available on some platforms, Windows - 64 bit (not itanium).
    The configuration is proving very challenging but will hopefully reap rewards.
    (Thought I would give you some background to my experience).
    Anyway my question to you is having looked at Jdeveloper it appears to do almost anything except consume services into the database, also with Java now being at version 1.5 outside the database for 10gR2 and supporting 1.4 inside, do you see some alignment of these in future database releases?
    Finally off to buy your book now as no doubt there is a huge amount more to learn.
    Kind Regards
    David O'Donnell

  • Reading and writing to a MySQL database with Java

    Anyone knows what's the best way to read and write from a MySQL database?

    > Anyone knows what's the best way to read and write
    from a MySQL database?
    Yep!
    The Java� Tutorial - Trail: JDBC� Database Access
    MySQL Reference Manual
    MySQL Connector/J Documentation
    Driver/Datasource Class Names, URL Syntax and Configuration Properties for Connector/J
    Best of luck!
    ~

  • Browse Linux RPM database with Java

    I found that RPM database in Red Hat Linux is based on Berkeley DB. I found this document for Java and Berkeley DB:
    http://docs.oracle.com/cd/E17076_02/html/gsg/JAVA/BerkeleyDB-Core-JAVA-GSG.pdf
    I found that there are two version of Berkley DBL native and Java edition. Can use this package
    https://www.odesk.com/leaving-odesk?ref=http%3A%2F%2Fwww.findjar.com%2Fjar%2Fberkeleydb%2Fberkeleydb-native%2F4.2%2Fberkeleydb-native-4.2.jar.html%3Fall%3Dtrue
    to access the RPM database file in /var/lib/rpm?

    As far as I know what is in the RPM distribution is what we call BDB core which is the C edition.   Within the BDB family of products there is the C version, a java version and an XML version.    Internally code is shared between the products of the family and we internally take care of compatibility.   The C version of BDB (shipped in Linux) has several different APIs that can be used, namely, C, Java, C#, C++, python, perl.  The document that you referring to is the JAVA API doc for BDB core.   When folks typically say Java edition, then are referring to the java version which we call BDB JE.    This is a separate product. 
    thanks
    mike

  • Disconnected database with java on Ipaq

    Hi,
    How can I work with a disconnected database using Jeode on iPaq? I need to synchronize the local database to a database on desktop too. I don�t wanna use comercial paid softwares like Oracle Lite, Pointbase, SqlServer CE.
    Thanks a lot,
    Renato Person
    System Developer

    Try www.hsqldb.org
    Martin

  • Connect staroffice8 database with java

    Hi,
    I m developing a reporting tool where i would have to connect to a staroffice 8 database (star base). The database has .odb extension. The reporting tool will run on a solaris network. I tried searhcing for JDBC driver to connect the staroffice database.
    please help!!
    regards,
    kunal

    i dont think it uses adabase .. and also i checked the entire google and the sun site .. but could not find any information ..also staroffice provides with a driver com.sun.star.comp.sdbc.JDBCDriver .. but i m not sure if its the right one to use ..
    regards,
    kunal parmar

  • Accessing oracle 10g  database with java

    Hello every body,
    i need to connect oracle 10 g remotely.could u please tell me wheather i need to install oracle 10g client in my local system..?if it is necessary what are steps i need to take care..like url of the connection .
    Please help me .am struggling from past three days.
    regards,
    Anil.

    i need to connect oracle 10 g remotely.Can you spell "security hazard"?
    could u please
    tell me wheather i need to install oracle 10g client
    in my local system..?No. Just the JDBC drivers.
    Please help me .am struggling from past three days.Ever considered asking a peer right on day one instead of wasting three days?

  • Java ODBC image database with MS Access

    hi ,
    Can any one please tell me if it is possible to put and get image from MS Access database with java JDBC ODBC driver? If it is possible then what will be the data type in Access and java. Thanks in advance ��

    I've not seen a data type in Access that would be
    appropriate for iimages--and I believe Access may
    still have an overall size limitation (this may have
    been taken off in Access 2003). If this were Oracle, you'd be using a BLOB. But the reasoning that follows would be the same, regardless of database.
    What I'e had best
    luck doing is leaving the files in their native
    format and storing them in directory structures to
    keep them segregated if need be, and storing their
    names and locations in the DB.This is what I've seen done. It makes little sense to stick the JPEG bytes in the database. You can't use them in a WHERE clause. They just kill database performance. morgalr's solution is a good one.
    %

  • Problem with updating oracle DB with java date thru resultset.updateDate()

    URGENT Please
    I am facing problem in updating oracle database with java date through resultset.updateDate() method. Can anybody help me please
    following code is saving wrong date value (dec 4, 2006 instead of java date jul 4, 2007) in database:
    ResultSet rs = stmt.executeQuery("SELECT myDate FROM myTable");
    rs.first();
    SimpleDateFormat sqlFormat = new SimpleDateFormat("yyyy-mm-dd");
    java.util.Date myDate = new Date();
    rs.updateDate("myDate", java.sql.Date.valueOf(sqlFormat.format(myDate)));
    rs.updateRow();

    I believe you should use yyyy-MM-dd instead of yyyy-mm-dd. I think MM stands for month while mm stands for minute as per
    http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
    (If this works, after spending so much of your time trying to solve it, don't hit yourself in the head too hard. I find running out of the room laughing hysterically feels better).
    Here is a more standard(?) way of updating:
    String sqlStatement=
    "update myTable set myDate=? where personID=?"
    PreparedStatement p1= connection.prepareStatement(sqlStatement);
    p1.setDate(1,new java.sqlDate());
    p1.setInt(2, personID);
    p1.executeUpdate();

Maybe you are looking for

  • Photoshop CS2 crashes on startup (Mac OS X 10.6.6)

    We have a new Mac in the office. We initially tried to copy all documents/programs from the old to the new, but for some reason, we noticed Photoshop CS2 would crash when we booted it up. So we uninstalled CS2 entirelly and reinstalled the suite. Sti

  • Fault message in synchronous scenario

    I defined an integreationprocess with synchronous send step and an exception branch. And I specified an exception for a fault message which I defined in the synchronous interface. My problem is, that the exception is not triggered by application erro

  • Newbie with Distortion Problem, Audigy 2

    Hello all you helpful people,?Seams common problem having spent the last 3 hours reading through the many posts on this subject, have to say the most helpful (easy to follow) was Jeremy's "read this before you post". Good man but unfortunatly it didn

  • Need help with a simple application

    hi guys, i am doing a school project. i used studio enterprise 8 to create a j2ee application, using mysql as the database. i believe i have installed all the encessary and the classpaths are right. i coded, build and run the application, but it isnt

  • ALV GRID WEB DYNPRO ABAP CREATE FUNCTION BUTTON ON A NEW LINE?

    Dear all, I'd like to create 2 pushbuttons on a second line of the alvgrid toolbar Is there any way to do that ? Regards