Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JDBC and Relational Databases
Search Coderanch
Advance search
Google search
Register / Login
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:
Campbell Ritchie
Devaka Cooray
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Jeanne Boyarsky
Tim Cooke
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Tim Moores
Mikalai Zaikin
Carey Brown
Bartenders:
Forum:
JDBC and Relational Databases
SQL exception:could not resolve service name
Ajay Divakaran
Greenhorn
Posts: 22
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I have Oracle9i installed.
When I run this program I get an sql exception on line 8 stating that "could not resolve service name"
import java.sql.*; public class TestOCIApp { public static void main(String args[]) throws ClassNotFoundException,SQLException { Class.forName("oracle.jdbc.driver.OracleDriver"); Connection conn = DriverManager.getConnection("jdbc:oracle:oci:@dssora01.dss","scott","tiger"); Statement stmt = conn.createStatement(); ResultSet rset = stmt.executeQuery( "select 'Hello OCI driver tester '||USER|| '!' result from dual"); while(rset.next()) System.out.println(rset.getString(1)); rset.close(); stmt.close(); conn.close(); } }
I wish to win the lottery. I wish for a lovely piece of pie. And I wish for a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
component layout not wrapping inside Panel
Trouble Printing with java 1.4!
Reading large text files with multiple data types and items.
Sorting Array of Strings
How to iterate in pure SQL?
More...