NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Invalid Oracle URL specified

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
cliveswan



Joined: 30 Nov 2009
Posts: 4

PostPosted: Thu Mar 11, 2010 11:53 am    Post subject: Invalid Oracle URL specified Reply with quote

Hi,

I have spent 2 days trying to get this working. Going round in circles.
I would really appreciate some assistance!!

Error: Invalid Oracle URL specified

I added the oracle thin driver
Services> Database> Driver> oracle.jdbc.driver.OracleDriver


<%@ page import="java.sql.*" %>
<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<html>
<body>

<%
Connection con = null;
Statement st;
ResultSet rs;
String sql = "";
String ProjectID = "";

sql = "SELECT * FROM Project";

try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:thin@localhost:1521:orcl","test","test");
st = con.createStatement();
rs = st.executeQuery(sql);
%>
<table border=2>
<%
while(rs.next())
{
%> <tr>
<td><%=rs.getString("ProjID")%></td>
<td><%=rs.getString("SubID")%></td>
<td><%=rs.getString("AsID")%></td>
<td><%=rs.getString("Name")%></td>
</tr>


<% } %>
</table>
<%
rs.close();
con.close();
}

catch(Exception ex)
{
out.print(ex.getMessage());
}
%>
</body>
</html>
Back to top
cliveswan



Joined: 30 Nov 2009
Posts: 4

PostPosted: Thu Mar 11, 2010 2:06 pm    Post subject: Reply with quote

Hi

Eventually noticed it was missing a :
con = DriverManager.getConnection("jdbc:oracle:thin@localhost:1521:orcl","test","test");

Should be
("jdbc:oracle:thin:@localhost:1521:orcl","test","test");
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo