Results 1 to 6 of 6

Thread: Database generator for java

  1. #1
    Join Date
    Dec 2009
    Posts
    292

    Database generator for java

    Hello,
    I am beginner in java I have a small problem to get a generator of database.
    Let me explain:
    The program should generate a database with a random size that gives the user the database contain a single table has two fields a field ID and field condition. If some one has an idea of how to do this, then please let me know. Thanks in advance.

  2. #2
    Join Date
    Nov 2009
    Posts
    518

    Re: Database generator for java

    Hello,
    I think what you are asking about is the JDBC drivers for java. I guess I am correct here. If not for creating a database, may be it is something installer of MySQL, create the table and fill them (on using SQL with command line). If not with java you will create the class that is filled table and retrieves information (JDBC). I hope this is your requirement. If not then please clarify your exact requirement.

  3. #3
    Join Date
    Nov 2009
    Posts
    333

    Re: Database generator for java

    Hello,
    I do not know what you are talking about, I have not heard any thing like this before which generates a database it self. I think you need a installer with java which will provide ( may be what is called MySQL or Oracle, which are system database). I think you require JDBC database drivers to bridge the database and the java code. I guess I am correct here, because this is what it usually is done for database connection in java.

  4. #4
    Join Date
    Nov 2009
    Posts
    356

    Re: Database generator for java

    Hello,
    I have a code with me, see if this helps you
    Code:
    private Connection c;
    private Statement s;
    
    
    Public JDBC_Image () (
    try (/ / register the driver
    Class.forName ( "com.mysql.jdbc.Driver");
    c = java.sql.DriverManager.getConnection ( "jdbc: mysql: / / localhost /name of the table? user = root & password =..........");
    / / System.out.println ( "JDBC Driver = OK");
    ) catch (ClassNotFoundException e) (
    System.out.println (">>>>>>> <<<<<< JDBC driver error ");
    System.err.println (e.getMessage ());}
    catch (SQLException e) (
    / / TODO Auto-generated catch block
    e.printStackTrace ();
    )
    
    )

  5. #5
    Join Date
    Nov 2009
    Posts
    359

    Re: Database generator for java

    Hello,
    I have modified the above code, you can see in the code that is the instruction are written in the code of how to connect to the database. Check it out
    Code:
    public void insert () (
    
    qryins String = "insert into table name (Variable,Variable) Values ('"+....+"','"+......+"')";
    
    try (/ / connection and query execution
    
    s = con.createStatement ();
    s.executeUpdate (qryins);
    System.out.println (qryins);
    / / s.close () / / Close the statement
    ResultSet r = s.executeQuery (querySelectId);
    )
    ) Catch (SQLException ex) (
    System.err.println (">>>>>>> Standard Connection <<<<<<<<");
    System.err.println (ex.getMessage ());
    )
    
    )

  6. #6
    Join Date
    Nov 2009
    Posts
    583

    Re: Database generator for java

    Hello,
    You create a software management of data (the Micrososft access) is connected, it has any popular base to jdbc. You use a JTable beautiful fine menu. And voila you have an access compatible with any database running on any system. Another idea tool for developers to build graphically JFrame. Hope this information will help you and if you have any more problems then do post back and we will try to solve it.

Similar Threads

  1. How a Java program can be connected through database ?
    By Chellam in forum Software Development
    Replies: 4
    Last Post: 09-12-2010, 08:41 AM
  2. Java in oracle 9i database
    By Gerri in forum Software Development
    Replies: 4
    Last Post: 03-02-2010, 08:35 PM
  3. Connection of Java applications to Database
    By Gerri in forum Software Development
    Replies: 3
    Last Post: 27-01-2010, 02:58 PM
  4. Java and database
    By AMISH in forum Software Development
    Replies: 5
    Last Post: 12-12-2009, 07:17 PM
  5. Java Code for College Database
    By Basaam in forum Software Development
    Replies: 2
    Last Post: 23-05-2009, 10:33 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,961,614.10923 seconds with 17 queries