Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
High Performance Python for Data Analytics
this week in the
Python
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Paul Clapham
Ron McLeod
Bear Bibeault
Liutauras Vilda
Sheriffs:
Jeanne Boyarsky
Tim Cooke
Junilu Lacar
Saloon Keepers:
Tim Moores
Tim Holloway
Stephan van Hulst
Jj Roberts
Carey Brown
Bartenders:
salvin francis
Frits Walraven
Piet Souris
Forum:
Beginning Java
Query about Connection interface
sparsh khandelwal
Ranch Hand
Posts: 76
posted 8 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
hello everyone,
i try the following command
import java.sql.*; class MySql{ public static void main(String args[]){ Connection con=null; String user="root"; String pass="root"; String db="don"; String driver="com.mysql.jdbc.Driver"; String url="jdbc:mysql://localhost:3306/"; try { Class.forName(driver); con=DriverManager.getConnection(url+db,user,pass); System.out.println(con); System.out.println("Connected"); con.close(); System.out.println("Disconnected"); } catch(Exception e) { e.printStackTrace(); } } }
and found the output as given in snapshot,
i am new to
jdbc
, i am not able to understand the output of this command here
System.out.println(con);
ScreenShot006.jpg
Greg Charles
Sheriff
Posts: 3036
12
I like...
posted 8 years ago
1
Number of slices to send:
Optional 'thank-you' note:
Send
You first print out your connection object, which just prints the reference used by the JVM to keep track of the object. Then you print the words Connected and Disconnected, so that's what you see in the console. What are you hoping to see?
sparsh khandelwal
Ranch Hand
Posts: 76
posted 8 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
thanks for your reply,i don't know about this
connection object, which just prints the reference used by the JVM to keep track of the object
thank you
Live a little! The night is young! And we have umbrellas in our drinks! This umbrella has a tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
jdbc connectivity working fine in eclipse but not on deploying the same on tomcat by making war
print data to textarea
DriverManager.getConnection hangs from actionPerformed
java jdbc
connecting java application to JAVADB database
More...