Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners java coding for creating table in the console

Have Programming Question? Ask it here!
 
 
 


DILEEPKRISHNA
java coding for creating table in the console
1 Answer(s)      3 years and 2 months ago
Posted in : Java Beginners


write a java program to create table


Advertisement
View Answers

July 18, 2011 at 4:07 PM


Java create database table

import java.sql.*;
import java.util.*;

class CreateTable{
    public static void main(String[] args){
        try{
        Scanner input=new Scanner(System.in);
        System.out.print("Enter Table name: ");
        String tab=input.nextLine();
            Class.forName("com.mysql.jdbc.Driver");
            Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root");
            Statement stmt=con.createStatement();
            String table = "CREATE TABLE "+tab+"(id integer)";
            stmt.executeUpdate(table);
            stmt.close();
            System.out.println("Table is created successfully");
            }
            catch(Exception ex){
            System.out.println(ex);
            }
        }
}

Java Create Multiplication Table

public class MultiplicationTable{
public static void main(String[] args){
    int sum=0;
int[][] array = new int[11][11];
for(int i=1; i<array.length; i++) {
for(int j=1; j<array[i].length; j++){
array[i][j] = i*j;
System.out.print(" " + array[i][j]);
}
System.out.println("");
}

}
}


Related Tutorials/Questions & Answers:
java coding for creating table in the console
java coding for creating table in the console  write a java program to create table
ClearScreen in Console Java
ClearScreen in Console Java  How can I perform Clear Screen Operation in Java. As we used to do in C++ using clrscr(); Please guide
Advertisements
java console programming - Java Beginners
java console programming  how to clear d screen in java console programming
creating instance of table in jsp
creating instance of table in jsp  i face senario look kie as follows... file is obviously a jsp page and shows the output in table manner. 3) now i want to make the instance of the data present in that paarticular table.... how i do
creating table in hibernate
creating table in hibernate  how to create table by the help of hibernate   There are 2 alternatives to create table in hibernate: 1... javax.persistence.Table; @Entity @Table(name = "TBLCOURSES") public class Course
CONSOLE
CONSOLE  system.out.formt();...how it works...?   System: It is a class made available by Java to let you manipulate various operating... class. Standard output is, on most operating systems, console output. format
Java Coding
Java Coding  Hello, Can u please tel me how to improve my coding techniques.I am feeling difficulty with coding but I am perfect with my theory part
java coding
java coding  Hai,I am having order table in mysql database.when user click download button the order table data shows in csv format.Its very urgent.please help me. Thanks in advance
coding in java
coding in java  write a code to calculate the product of odd integers from 1-15   class ProductOfOddIntegers { public static void main(String[] args) { long product=1; for(int i=1;i<=15;i
Redirecting the console output into a file in Java
Redirecting the console output into a file in Java  Hi, i coded a program that read specific lines from a text file. It's working well. Now i want to redirect the output of the console to a text file. i used your tutorial
java coding
java coding  Hi sir, WRITE A PROGRAMME TO MAKE EMPLOYMENT MANAGMENT HAVING COLORS AND FRAME IN IT,???? CAN U SUGGEST ME HOW TO MAKE IT IN CORE JAVA
java coding
java coding  sir i need code for how to send meg from one system to another system
java coding
java coding  i need to to a project in java and the title is file parsing. i need to read a file or if a particular file is given i have to count the no of vowels, pick out some terms, and to display the details about that file
java coding
java coding  i am using netbean to my project and it is Desktop Application.i want my textfield to accept only numbers or only alphabets .........plez plez plez do help me..........i am just beginner to java codes
java coding
java coding  using swing i want to give an exit button which on clicking ask a msg "JOptionPane" is select "yes" then it should exit or else not....plez help me...... JOptionPane.showConfirmDialog(null,"DO YOU REALLY WANT
java coding
java coding  plz correct this one ....i want to retrive data row from databse ...all its working but for combobox it not.......plz plz plz help me...... private void jButton4ActionPerformed(java.awt.event.ActionEvent evt
Java coding for beginners
very beginning. Tutorial Java coding for beginners will enable you to know about the Java Coding and its various aspects during programming. It also introduces you with the Java Programming language and coding. In this topic, students
java coding
java coding  (person, student,employee, faculty and staff are classes) design a class named person and its two subclasses named student and employee    class Person { public String name; public String address; public
java coding
java coding  can any one plez tell me how to retrive a row from access to each field of swing... i hav tried this but i am getting an SQL error "SQLExceptionOccurred[Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect
How to capture output from console into textarea in java?
How to capture output from console into textarea in java?  Hi, I would like to know how can we display the result of a program in java into a textarea instead of displaying it on console. Thanks
Java coding - WebSevices
Java coding for web services  How to start Java Coding for web services
Java Coding - Java Beginners
Java Coding  Code a for loop that adds the integers that are multiples of 5 starting with 50 and ending with 5. Each time the sum is increased, print it on a line at the console. Be sure to declare and initialize any required
Java Coding - Java Beginners
Java Coding  Code a private static method named printMessage that accepts a String parameter that represents the message. The method should simply print the message followed by a blank line at the console. Write a statement
Java Coding - Java Beginners
Java Coding  Code nested for loops that calculate the area of a rectangle that can range in size from a length and width of 1 to a length and width... at the console followed by a space. Be sure to declare and initialize any required
Creating a MySQL Database Table to store Java Types
Creating a MySQL Database Table to store Java Types... are providing you an example with code for creating a table to store java types. Brief... to store a java types in our database table. Now one question may arise in your
java coding - Java Beginners
java coding  dear sir, i'm doing a java coding using with netbeans ide, so i'm trying to pass some text from one jframe to another jframe which is both are already opend on screen then how to do it? please send me
Image using Java coding
Image using Java coding  Hai, Display image in pdf file using Java coding through Xsl file.. Please help me.. xsl file generate the pdf file
Java Coding - Java Beginners
Java Coding  How do I code the following: Code a while loop... and ending with 100. Each time the sum is increased, print it on a line at the console... on Java visit to : http://www.roseindia.net/java/ Thanks
Creating a memory leak with Java
Creating a memory leak with Java  Creating a memory leak with Java
coding - Java Beginners
coding  i need to start coding but i don't know how to start it so plz help me  Hi Friend, Please visit the following link: http://www.roseindia.net/java/ Thanks
color coding in java
color coding in java  hii..can anyone please help with auto coloring code in java swings..??a particular text field should have a particular color for a particular event..plzz help
Java Coding - Date Calendar
Java Coding  Write a program that prompts the user to enter the year and first day of the year and displays the calendar for the year on the console. For example,if the user entered the year 2005, and 6 for Saturday, January
console application - text-based menu - Java Beginners
console application - text-based menu  Im doin a text-based menu console application. I have created five classes: namely: 1. addproduct 2. updateproduct 3. deleteproduct 4. view product 5. productmain i used Scanner
coding problem - Java Beginners
coding problem  hi! i declared date as date datatype in oracle now i need to retrieve date from database to my java code.how can i please help me... the date from the MySql database. For this we have create a table date(id,myDate
single frame coding in java
single frame coding in java  sir, i am a beginner in java.i want to do a desktop application in java in which a single frame satisfies all needs.but i want changes in that frame only.how can i solve this?i think multiple frames
Which one is better for creating a GUI using swings either Manual coding or IDE(NetBeans,eclipse)..? drag and dropping components
Which one is better for creating a GUI using swings either Manual coding or IDE... in java application developing.... Which one is better for creating a GUI using swings either Manual coding or IDE(NetBeans,eclipse)..? drag and dropping components
coding problem - Java Beginners
coding problem  i used netbeans software to develop frame.now i need to add values to JList from ArrayList object  Hi Friend, Try...( )); jlist.setFocusable(false); JFrame frame = new JFrame("Creating a JList
Coding - Java Beginners
Coding  How to do a coding to view employee name, salary and EPF. The EPF is calculated from the salary like 10% from their salary. and it also show... the technologies you create the application in Java/JSP/Servlet/JSF/Struts
coding - Java Beginners
coding  i need start coding but don't have any idea to start plz help me
java coding - Java Beginners
java coding  how to create a window that contain a list of all files of specified directory
coding related - Java Beginners
coding related  what is the purpose of using these line in a program? char units = args[1].charAt(0); units = Character.toUpperCase.../java/java-conversion
Java Coding - Java Beginners
Java Coding  What is the meaning of following statement in Java? Clasname objectname = another_object_name.method_name; The Example Code is Given Below public void sessionCreated(HttpSessionEvent sessionEvent
coding problem - Java Beginners
coding problem  hi friend! Im new to jasper reports.how can i start that coding inorder to generate reports.can u send some sample programs for reporting?im badly need some clearly mentioned example because im new to jasper
Java Coding - Java Beginners
Java Coding  Two overloading methods that returns average using following headers A) public static int average(int[] array) B) public static double average(double[] array The program should prompt the user to enter
j2me coding - Java Magazine
in sms using j2me. i have a problem in coding for sending and receiving sms .i have a coding for receiving sms but it not work because that program need sending... a coding for sending and receiving sms in j2me
Java Coding - Java Beginners
Java Coding  How do I code the following: Code a switch statement that tests the value of an int variable named weightInt. This variable contains the weight of a shipment rounded up to the nearest multiple of 5. If the value
Java Coding - Java Beginners
Java Coding  How do I code the following: Code a private static method named getUPSShipping that accepts a double value named weight and an integer named zipCode and returns a double value. This method should set the value
JAVA Coding - Java Beginners
JAVA Coding  Have to write a function that will write out from 1..., q ; if ( number < 10 ){ show ( st1[number] ) ; } if ( number > 9... = number % 10 ; if ( word == 0 ){ q = number / 10 ; show ( st4[q-2] ) ; } else
Java Coding - Java Beginners
Java Coding  Write a program containing two functions, bubbleSort( ) and mergeSort( ). Each function should take an array of integers, sort the array using the appropriate algorithm and then return the sorted array
Java Coding - Java Beginners
Java Coding  How do I code the following? Code an if/else statement that tests the value of a string variable named shippingMethod to determine if it has a value of ?UPS,? ?FEDEX,? or another value. If the value is ?UPS,? call
Advertisements
 

 

 

DMCA.com