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
OCP Oracle Certified Professional Java SE 21 Developer (Exam 1Z0-830) Java SE 17 Developer (Exam 1Z0-829) Programmer’s Guide
this week in the
Programmer Certification
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
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Tim Cooke
Campbell Ritchie
paul wheaton
Ron McLeod
Devaka Cooray
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Paul Clapham
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
Forum:
Beginning Java
Query about Connection interface
sparsh khandelwal
Ranch Hand
Posts: 76
posted 13 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: 3064
12
I like...
posted 13 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 13 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
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
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...