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



Home Answers Viewqa JDBC creating jdbc sql statements
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


prashanthi
creating jdbc sql statements
1 Answer(s)      6 years and 7 months ago
Posted in : JDBC



Advertisement
View Answers

June 6, 2008 at 3:17 PM


Hi friend,


i think, connection problem. i am sending jdbc connection code

import java.sql.*;

public class DatabaseConnect{
public static void main(String[] args) {
System.out.println("MySQL Connect Example.");
Connection con = null;
String url = "jdbc:mysql://192.168.10.211:3306/";;
String db = "amar";
String driver = "com.mysql.jdbc.Driver";
String userName ="amar";
String password="amar123";
try {
Class.forName(driver).newInstance();
con = DriverManager.getConnection(url+db,userName,password);
System.out.println("Connected to the database");
con.close();
System.out.println("Disconnected from database");
} catch (Exception e) {
e.printStackTrace();
}
}
}

----------------------------------

Read for more details.

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

Thanks


Related Tutorials/Questions & Answers:
creating jdbc sql statements - JDBC
creating jdbc sql statements  I had written the following program...=DriverManager.getConnection("jdbc:odbc:second"); stmt=con.createStatement...)   Hi friend, i think, connection problem. i am sending jdbc
Jdbc statements
Jdbc statements  what is the use of Callable Statement
Advertisements
Jdbc statements
Jdbc statements  what type of a method is get Connection
The INSERT INTO Statements in SQL?
The INSERT INTO Statements in SQL?  The INSERT INTO Statements in SQL?   Hi, The INSERT INTO statement is used to insert a new row or multiple rows into a table. SQL INSERT INTO Syntax INSERT INTO table_name VALUES
What is the Delete Statements in SQL?
What is the Delete Statements in SQL?  What is the Delete Statements in SQL?   Hi, Here is the answer, Delete statement in SQL is used to delete partial/all data. Especially delete statement is useful in case
Executing Set of SQL statements in Java
Executing Set of SQL statements in Java  Hi, I am trying to execute a procedure which is stored in MS SQL server's database. I have configured..."); conn=DriverManager.getConnection("jdbc:odbc:drivername", "uid", "pwd
Hibernate generated SQL statements on console
Hibernate generated SQL statements on console  If you want to see the Hibernate generated SQL statements on console, what should we do?   If you want to see the Hibernate generated SQL statements on console just add
Sql Connection is not creating
it is creating sql connection and allwoing me to access excel but when i am...Sql Connection is not creating  Hi i am developing an web application..for that i am using excel as database. To connect for database am using jdbc
Show Hibernate generated SQL statements on console
Show Hibernate generated SQL statements on console  How can i see Hibernate generated SQL statements on console?   In Hibernate configuration file add the following: <property name="show_sql">true</property>
Statements in JDBC - Java Interview Questions
Statements in JDBC  Hi, Explain statement, preparedstatement, callable statement. which is best and why. when to use preparedstatement. plz dont give link . explain ur words with example
Why we use Semicolon after SQL Statements?
Why we use Semicolon after SQL Statements?  Why we use Semicolon after SQL Statements?   Hi, Some database systems require a semicolon at the end of each SQL statement.The semicolon character is a statement
executing multiple sql statements on the single button click...
executing multiple sql statements on the single button click...  how can i frame a code on the click of a button to insert data into a table as well as to retrieve records from the same table in another form
executing multiple sql statements on the single button click...
executing multiple sql statements on the single button click...  how can i frame a code on the click of a button to insert data into a table as well as to retrieve records from the same table in another form
Creating Cursors in SQL
Creating Cursors in SQL       Creating Cursor in SQL is used to create a cursor in SQL... Creating Cursor in SQL. To understand it, we create a table 'Stu_Table
Creating Database - SQL
Creating Database  Hi I am Guru I am having the confusion in creating the database.Actually Just I joined one small company. I am... ciao.co.uk. we are creating the database in mysql. 1> category->subcategory->
Understanding Common SQL statements
Understanding Common SQL statements       The commonly used SQL statements are: 1... SQL Select statement: The SELECT statement is used to select data from
Creating Cursors in SQL
Creating Cursors in SQL       Creating Cursor in SQL is used to create a cursor in SQL... Creating Cursor in SQL. To understand it, we create a table 'Stu_Table
sql - JDBC
SQL joins queries   Hi, can anyone give me the couple of SQL joins queries with examples
sql - JDBC
key constraints in SQL server  Does SQL have a FOREIGN KEY constraints in a Table
sql-jdbc
sql-jdbc  how to execute select query using prepared statement
netbeans ddl and dml sql statements - Java Beginners
netbeans ddl and dml sql statements  Kindly send me the ddl,dml and tcl commands while in netbeans. wilson
sql - JDBC
://www.roseindia.net/jdbc/jdbcconnectivity.shtml You will find the solution. Thanks
Sql - JDBC
SQL Statement and prepared statement  What is Statement and prepared statement in SQL  Statement and prepared statement are the interfaces declared in JAVA.SQL.While you connecting to a database these are required.If
".txt" to sql with JDBC
".txt" to sql with JDBC  how to insert ".txt" into sql result[BLOB] with JDBC
My sql - JDBC
,emp_vertical,emp_supervisor. i need a JDBC program with driver mangager for MySQL, statements, preparedstatements,resultset. Please can you suggest me a way out. i need insert and update queries.  Hi friend, For JDBC
jdbc & sql related project - JDBC
jdbc & sql related project  code using jdbc,odbc,swing,MySql classes to create front-end of any jdbc that allows the user to select any database from a list and execute any sql query related to the selected database e.g
JDBC Transaction Example
; } JDBC Transaction Example JDBC Transaction  JDBC transaction is used to execute a group of SQL statement so that they can execute together successfully. When  you create a connection using JDBC, by default
JDBC connection and SQL Query - JDBC
JDBC connection and SQL Query  Hi, I'm reading a all files one after the other in a directory in java. storing the values in an array of string each time. Now I'm trying to execute a query to insert those values into an oracle
Connectivity with sql in detail - JDBC
Connectivity with sql in detail  Sir/Madam, I am unable to connect the sql with Java. Please tell me in detail that how to connect...; String url = "jdbc:mysql://localhost:3306/"; String dbName
sql query - JDBC
sql query  I need a SQL query to add data into database
Connections with MicroSoft SQL - JDBC
Connections with MicroSoft SQL  How to Connect Java and MS SQL?? Actually i used below code i got SQLException and class not found... import...; Statement st = null; ResultSet rs = null; String url = "jdbc
Advertisements
 

 

 

DMCA.com