mysql tables

mysql tables

View Answers

October 1, 2008 at 11:20 AM

Hi,

You not mention ur requirement properly mean insert or update or select or what?

I gave a sample program you have to modify as per ur field.

package rajanikant.code.oct_2008;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class MySqlTest {

private Connection con = null;
private Statement stmt;
private PreparedStatement pst;

private ResultSet rs ;

public void getConnection(){
try {
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/databasename";, "root", "");
} catch (ClassNotFoundException e) {
System.out.println("Driver Class Not Found");
} catch (SQLException e) {
System.out.println("Connection Error");
}
}

public void myStuff(){
getConnection();

try {
stmt = con.createStatement();
rs = stmt.executeQuery(" Your Query");

pst = con.prepareStatement("Insert Into your-tablename values(?,?,?,?)" );
//depend upon "?" we have to write the following line
pst.setString(1, "value1");
pst.setString(2, "value2");
pst.setString(3, "value3");
pst.setInt(4, 6);
rs = pst.executeQuery();
} catch (SQLException e) {

}
}

public static void main(String s[]){
new MySqlTest().myStuff();
}
}


Rajanikant

October 1, 2008 at 11:27 AM

Hi,


I am sending a link. This link will help you.

Please visit for more information.

http://www.roseindia.net/jdbc/


Thanks.

Amardeep









Related Tutorials/Questions & Answers:
Different tables present in MySQL
Different tables present in MySQL  What are the different tables present in MySQL? Which type of table is generated when we are creating a table...; Hi friends, Total 5 types of tables we can create 1. MyISAM 2. Heap 3
Create Database and tables in MySQL
Create Database and tables in MySQL  Hi, How to create database and tables in MySQL Database? Explain me step-by-step as I am beginner in MySQL. Thanks   Hi, First of all you have to connect to MySQL database through
Advertisements
Mysql List Tables
Mysql List Tables       The Tutorial illustrate an example from 'Mysql  List Tables'. To understand this example we use show tables query that return the list
mysql select from multiple tables
mysql select from multiple tables   how can i select the date field from multiple tables in mysql?   "UNION" can be used to select data from multiple tables in my sql... for example (SELECT * from name where `name
mysql tables - JDBC
mysql tables  hi, I have a table in MySql, having fields, emp... mangager for MySQL, statements, preparedstatements,resultset. Please can you..."); con = DriverManager.getConnection("jdbc:mysql://localhost:3306/databasename
Mysql List Tables
Mysql List Tables       The Tutorial illustrate an example from 'Mysql  List Tables'. To understand this example we use show tables query that return the list
Purge Data from Mysql tables
Purge Data from Mysql tables  Hi, i have to write a mysql procedure to purge data from tables. but written procedure clear entire tables data. Please give me the solution for purging data. CREATE DEFINER=`root`@`localhost
Mysql Join 3 Tables
Mysql Join 3 Tables       Mysql Join 3 Tables is used to join 3 Tables using left join... The Tutorial illustrate an example from 'Mysql Join 3 Tables' using Left Join
Comparing tables
Comparing tables  How to compare two or more tables in the Mysql database using jdbc
Nest tables within tables
Nest tables within tables  Can I nest tables within tables
Setting up MySQL Database and Tables
Setting up MySQL Database and Tables       I am assuming that you have running instance of MySQL Database and you know how to work with the MySQL database. To access the database
tables for layout
tables for layout  Are there any problems with using tables for layout
tables for layout
tables for layout  Are there any problems with using tables for layout
CSV tables
CSV tables  hello, What are CSV tables?   hii,ADS_TO_REPLACE_1 CSV Tables cannot be indexed.CSV Tables are the special tables, data for which is saved into comma-separated values files
Mysql List
Mysql List       Mysql List elaborate you an Query for listing databases,tables... The Tutorial illustrate an example from 'Mysql List'. To grasp this example, We
Mysql List
Mysql List       Mysql List elaborate you an Query for listing databases, tables, Procedure... The Tutorial illustrate an example from 'Mysql List'. To grasp this example, We
use tables to structure forms
use tables to structure forms  How can I use tables to structure forms
use tables to structure forms
use tables to structure forms  How can I use tables to structure forms
tables to structure forms
tables to structure forms  How can I use tables to structure forms
tables to structure forms
tables to structure forms  How can I use tables to structure forms
ModuleNotFoundError: No module named 'tables'
ModuleNotFoundError: No module named 'tables'  Hi, My Python... 'tables' How to remove the ModuleNotFoundError: No module named 'tables'... to install padas library. You can install tables python with following command
Mysql Alter Tables
Mysql Alter Tables This example illustrates how to alert the table and how it is used in query. In this example you will see all tables in test database....  ADS_TO_REPLACE_1 Query show tables
program to create nested tables
program to create nested tables  program to create nested tables
SQL All Tables
SQL All Tables       SQL All Tables is used to show all the tables in database. Understand with ExampleADS_TO_REPLACE_1 The Tutorial illustrate an example from 'SQL All Tables
Join the two tables in sql
Join the two tables in sql  How to join the two tables in SQL ..and return the value from common column in SQL Database
MySQL Create Database
and MySQL Administrator, enabling the visual creation and modification of tables... MySQL Create Database        ... to create the database on MySQL Server. MySQL Database server is one of the very
PL/SQL tables
PL/SQL tables   hii, Describe the use of PL/SQL tables ?   hello,ADS_TO_REPLACE_1 PL/SQL tables are scalar arrays that can be referenced by a binary integer. They can be used to hold values for use in later queries
Joining tables using criteria
Joining tables using criteria  How do i join more than three tables and retrieve one column from parent table and count of unique values in a single column from child table,the joined tables must be maintain primary key
Using criteria for multiple tables
Using criteria for multiple tables  How to join more than three tables,those tables must be maintain primary key relation ship using Hql criteria & projections
Using criteria for multiple tables
Using criteria for multiple tables  How to join more than three tables,those tables must be maintain primary key relation ship using Hql criteria & projections
Learn how to take MySQL Backups and restore the same.
Learn how to take and then restore the MySQL database backup. You can use mysqldump utility to take the backup of MySQL database and tables with or without.... Following example shows how to take MySQL backup.ADS_TO_REPLACE_1
types of relationships in tables
-to-many and many-to-many relationships while designing tables?   hi... tables with primary and foreign key relationships.ADS_TO_REPLACE_1 One-to-Many relationships are implemented by splitting the data into two tables with primary
look up tables in java
look up tables in java  cachetables , how to apply cache mecanisam in java , i have some tables which is frequently used so i want to fetch first time and want to keep in some scope untill the application end . with out hitting
Get the list of tables in Sybase
Get the list of tables in Sybase   hello, How to get the list of tables in Sybase?   hii,ADS_TO_REPLACE_1 Select name from sysobjects where type="...." it will give You list according to where clause
PHP Join Tables
PHP Join Tables  i wanted to show the information from two or more table in PHP. How can i do it with the PHP Join Tables
join tables mysql
.style1 { font-weight: bold; } join tables mysql... and the result will be displayed in the browser. To join the tables firstly it is important... are using the MySql database. To join the table it is important to have those
MYSQL
MYSQL  How to create time and date based trigger in mysql   MySQL Time Trigger
tables in oracle 10g
tables in oracle 10g  sir i have created a table in oracle 10g,i want to know where this table is stored and how can i move this table to another pc and insert values
mysql
mysql  how to open\import table in .dbf format in mysql
Establish a Connection with MySQL Database
coding methods of establishing the connection between MySQL database and quartz application for updating and manipulating the data of MySQL database tables. Here... Establish a Connection with MySQL Database   
Elite Zebra Tables
Elite Zebra Tables       Elite Zebra Tables will turn your static html tables and boring web pages... original code. You can even have mutliple zebra tables on one page, all
Mysql Natural Join
Mysql Natural Join       Mysql Natural Join is a specialization of equi-joins. The join compares all columns in both tables that have the same column-name in both tables
Fixed size tables
Fixed size tables  Can anyone help me in creating a fixed size table in mysql database
mysql
you need to download the mysql-connector jar file for connecting java program from mysql database.......   Hi friend, MySQL is open source database... is the link for the page from where you can understand how to Download and Install MySQL
MySQL Access Control
control system and throws some light on the MySQL grant tables. These tables... MySQL Access Control       MySQL Security Access Control Most users concentrate on MySQL's databases
Welcome to the MySQL Tutorials
the MySQL performs a join that linking the rows from multiple tables... will learn Most users concentrate on MySQL's databases and tables... of tables.    MySQL Database
mysql
mysql  want the code for mysql nested select query with single where condition.want to select data from more than one table
MySql
MySql  what is default password of mySql, and how i configure mySql.   Hi, If you are installing MySQL on windows then you will have to provide the Password for the user root at the installation time.ADS_TO_REPLACE_1
Creating Database Tables and Indexes
Creating Database Tables and Indexes   ... the allowable syntax for identifiers in MySQL. The identifiers are Database, table, index... in identifiers. But avoidance of doing so if possible then it is best. The MySQL
ModuleNotFoundError: No module named 'cache-tables'
ModuleNotFoundError: No module named 'cache-tables'  Hi, My Python... 'cache-tables' How to remove the ModuleNotFoundError: No module named 'cache-tables' error? Thanks   Hi, In your python

Ads