|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
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
| |||
| |||
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
| |||
| |||
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
| |||
| |||
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
| |||
| |||
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
| |||
| |||
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. |
![]() |
|
Tags: columns, database, database drivers, fields, jdbc drivers, records, rows, tables |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How a Java program can be connected through database ? | Chellam | Software Development | 4 | 09-12-2010 08:41 AM |
Java in oracle 9i database | Gerri | Software Development | 4 | 03-02-2010 08:35 PM |
Connection of Java applications to Database | Gerri | Software Development | 3 | 27-01-2010 02:58 PM |
Java and database | AMISH | Software Development | 5 | 12-12-2009 07:17 PM |
Java Code for College Database | Basaam | Software Development | 2 | 23-05-2009 10:33 AM |