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
Win a copy of
Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework
this week in the
Java in General
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:
Campbell Ritchie
Tim Cooke
paul wheaton
Liutauras Vilda
Ron McLeod
Sheriffs:
Jeanne Boyarsky
Devaka Cooray
Paul Clapham
Saloon Keepers:
Scott Selikoff
Tim Holloway
Piet Souris
Mikalai Zaikin
Frits Walraven
Bartenders:
Stephan van Hulst
Carey Brown
Forum:
JDBC and Relational Databases
SQL exception:could not resolve service name
Ajay Divakaran
Greenhorn
Posts: 22
posted 16 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(); } }
Look! It's Leonardo da Vinci! And he brought a tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
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...