Connect on an oracle database from another computer
hi all,
i installed oracle database 10g express as well as sql developer on one of my laptop. Everything is ok as of the moment.
Now, i want to access that oracle database from my another laptop. Is this possible? let me know what should i do in order to achieve this.
thanks.
user13169035 wrote:
thanks for the help. basically here is the setup.
i have 2 laptops. the first one has oracle 10g database express install and sql developer. i can query my database from here using sql developer.
now, on my second one, i want to access the data from the database that i created from the first laptop. i want to access the data from the database from the first laptop using sql developer which i also installed on the 2nd laptop.
i already tried the link from http://www.oracle.com/technology/software/products/database/xe/files/install.102/b25144/toc.htm but didnt work (or maybe i missed something important).
What from the link did you try to follow? Did you try to follow the information in the link i posted, specifically ...
"4.4 Making Oracle Database XE Server Available to Remote Clients"
Once you have done that. You will need to know the IP or possible computer name of the computer on the network which is hosting the database (it would be easiest if the laptop with the database had a static IP assigned by your router, assuming this is a home setup, and you use that for your connection). You will need that information to create a new connection in SQLDeveloper on the laptop without the database installed.
Aside from that you may have to deal with windoze firewall issues and the like, but that removes this from being an Oracle question, you should be able to use google to deal with any issues you encounter in that.
Similar Messages
-
Connecting to a database from another computer...
hi guys!
i just wonder if there is a simple way to connect to my database from another computer?
do you have to change something in this method?
private static Connection getConnection() { Connection con = null; try { Class.forName("com.mysql.jdbc.Driver"); String url = "jdbc:mysql://localhost/Movies"; String user = "root"; String pw = "x"; con = DriverManager.getConnection(url, user, pw); System.out.println("****Connected****"); } catch (ClassNotFoundException e) { System.out.println(e.getMessage()); System.out.println("1"); System.exit(0); } catch (SQLException e) { System.out.println(e.getMessage()); System.out.println("2"); System.exit(0); } return con; }
thanks! :)
Edited by: Shaor-1 on Dec 22, 2008 3:47 AMhey!
is there no one who knows how to do this?
Here is my program that i want to change so it can connect to my mysql database but from another computer.
import java.sql.*;
import java.text.NumberFormat;
import java.util.logging.Level;
import java.util.logging.Logger;
public class ListMovies {
static String exist = "existed";
static int ye = 2221;
static double pr = 21.12;
public static void main (String[] args) throws InterruptedException {
go();
public static void go(){
NumberFormat cf = NumberFormat.getCurrencyInstance();
for(int i = 0; i < 1; i--){
ResultSet movies = getMovies();
try
while (movies.next()){
Movie m = getMovie(movies);
String msg = Integer.toString(m.year);
msg += ": " + m.title;
msg += " (" + cf.format(m.price) + ")";
System.out.println(msg);
Thread.sleep(1000*10);
catch (InterruptedException ex) {
Logger.getLogger(ListMovies.class.getName()).log(Level.SEVERE, null, ex);
} catch (SQLException e)
System.out.println(e.getMessage());
public static void loanMovie(String d) {
Connection con = getConnection();
try {
Statement stmt = con.createStatement();
String insert = "insert into movie "
+ "(title, year, price) "
+ "values ("
+ "\"" + d + "\"" + ", "
+ ye + ", " + pr +");";
int i =stmt.executeUpdate(insert);
if (i == 1){
System.out.println("Loan recorded");
else
System.out.println("Loan not recorded");
catch (SQLException e){
System.out.println(e.getMessage());
System.out.println("CRAP");
private static ResultSet getMovies()
Connection con = getConnection();
try {
Statement s = con.createStatement();
String select = "Select title, year, price " +
"from movie order by year";
ResultSet rows;
rows = s.executeQuery(select);
return rows;
catch (SQLException e)
System.out.println(e.getMessage());
return null;
private static Connection getConnection() {
Connection con = null;
try {
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://localhost/Movies";
String user = "root";
String pw = "x";
con = DriverManager.getConnection(url, user, pw);
System.out.println("****INFO****");
catch (ClassNotFoundException e)
System.out.println(e.getMessage());
System.out.println("1");
System.exit(0);
catch (SQLException e) {
System.out.println(e.getMessage());
System.out.println("2");
System.exit(0);
return con;
private static Movie getMovie(ResultSet movies) {
try {
String title = movies.getString("Title");
int year = movies.getInt("Year");
double price = movies.getDouble("price");
return new Movie(title, year, price);
catch (SQLException e)
System.out.println(e.getMessage());
return null;
private static class Movie
public String title;
public int year;
public double price;
public Movie(String title, int year, double price)
this.title = title;
this.year = year;
this.price = price;
BTW_
my computers ip is: 81.229.40.17
the database is on that computer.
thanks! -
Connect to a oracle database in another server
Hi people,
I have to read some tables on a oracle database in another server.
I know that I will have to use EXEC SQL command, but how can I make the connection between SAP and that oracle database.
I have seen something about the DBCON table, but I am not sure if I can connect on another server from ther and how...
Thanks...Dear,
Check the below links:
http://sap.ittoolbox.com/groups/technical-functional/sap-basis/connection-between-sap-system-with-external-oracle-database-with-tcode-dbco-1178583
http://help.sap.com/saphelp_nwpi71/helpdata/en/df/455ec9747111d6b25100508b6b8a93/content.htm
Hope it will help you.
Regards,
Alok Tiwari -
Remote connect to Windows Internal Database from another server
Hello,
I have a WSUS server which has Windows Internal Database installed. Now If I have to manage the database using SQL Server management studio, then I need to connect using the Server Name as \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query
Now, if I want to connect to the server that has Windows Internal Database installed, but does not have SQL Server Management Studio installed, then how to connect?
Please advice. Thanks in advance.
RajivYou can either install SQL Server management Studio or SQLCMD and then work with Windows Internal Database
Both of these are freely downloadable from microsoft website.
Please find the links for SQL 2014
Management Studio
http://www.microsoft.com/en-gb/download/details.aspx?id=42299
You can download one of these based on 32/64bit
MgmtStudio 32BIT\SQLManagementStudio_x86_ENU.exe
MgmtStudio 64BIT\SQLManagementStudio_x64_ENU.exe
SQLCMD
http://www.microsoft.com/en-gb/download/details.aspx?id=29065
Check the section Microsoft® SQL Server® 2012 Command Line Utilities
HTH
Regards, Ashwin Menon My Blog - http:\\sqllearnings.com -
Unable to open 10g Database Control Webpage from another computer
Unable to open 10g Database Control Webpage from another computer
Hi Gurus
I have just installed Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 on my PC Windows XP , created database and configured DB control
I can open Database Control Webpage on the database machine by typing
http://USI2374993VND0.vlgdw2k.visteon.com:1158/em
or
http://136.18.70.189:1158/em
But can not open it from another PC
When I do following from another PC
1. http://USI2374993VND0.vlgdw2k.visteon.com:1158/em
Get error: [code=DNS_NO_DATA] The IP address was not found during the DNS lookup. Contact your system administrator.
2. http://136.18.70.189:1158/em
Get error:Can not display web page
I can ping 136.18.70.189 but not USI2374993VND0.vlgdw2k.visteon.com
On the other PC I also tried adding 136.18.70.189 to
tools - internet options - security - local internet - sites - advanced - add this web
site to the zone as http://136.18.70.189
But it did not work
Please help with any ideas
Thanks a bunch
New DBAFirewalls?
DNS translation issues? -
Not able to connect database from another os user using externally?
Hi,
I want to connect database from another os user. i am able to connect database from oracle externally. but not able to connect different OS user.
As ORACLE User:
[oracle@test1 admin]$ sqlplus /
SQL*Plus: Release 11.2.0.2.0 Production on Mon Jan 16 19:41:57 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
Non ORACLE user:
[sample@test1 ~]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0.2/
[sample@test1 ~]$ export ORACLE_SID=rman
[sample@test1 ~]$ export PATH=$ORACLE_HOME/bin:$PATH
[sample@test1 ~]$ sqlplus /
SQL*Plus: Release 11.2.0.2.0 Production on Mon Jan 16 19:37:42 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0
Enter user-name:
ThanksYou didn't install Oracle correctly, especially you didn't run the root.sh and rootpre.sh scripts.
If you would have read the error message at all, and researched it, you would have known this.
Regrettably however you decided to ignore Forums Etiquette and to abuse this forum with Yet Another Doc Question.
Sybrand Bakker
Senior Oracle DBA -
How do I connect to a DB2 database from Oracle 10G on linux?
Hi
I have tryed to connect to a DB2 database from oracle 10 G on linux.
I have installed unixODBC and a db2 odbc driver. I can connect to the db2 using isql, but oracle comes with this error:
select * from testtable@acc_spc_gr2
ERROR at line 1:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Generic Connectivity Using ODBC]DRV_InitTdp: DB_ODBC_INTERFACE (718): ; [C077]
Could not find symbol 'SQLAllocConnect' in dynamic library
DB_ODBC_INTERFACE (722): ; [C079] Failed to load dynamic library
'/opt/ibm/iSeriesAccess/lib/libcwbodbc.so'
ORA-02063: preceding 3 lines from ACC_SPC_GR2
What am I doing wrong? Any one have a guide to do this?
- Jesperthis is my complete configuration
Database_
-bash-3.2$ export ORACLE_SID=XE
-bash-3.2$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Mié Jul 7 10:04:43 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Conectado a:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Platform_
Linux srvpdf 2.6.18-164.el5xen #1 SMP Thu Sep 3 04:47:32 EDT 2009 i686 i686 i386 GNU/Linux
*/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/hs/admin/initDB2DATABASE.init*
#This is a sample agent init file that contains the HS parameters that are
# needed for an ODBC Agent.
# HS init parameters
#HS_FDS_CONNECT_INFO = ODBC_DSN
HS_FDS_CONNECT_INFO = prueba
HS_FDS_TRACE_FILE_NAME = /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/hs/admin/DB2DATABASE.log
HS_FDS_CONNECT_INFO = DB2DATABASE
#HS_FDS_TRACE_LEVEL = debug
HS_FDS_TRACE_LEVEL = 0
HS_FDS_SHAREABLE_NAME = /opt/ibm/iSeriesAccess/lib/libcwbodbc.so
# ODBC specific environment variables
set ODBCINI=/etc/odbc.ini
# Environment variables required for the non-Oracle system
set DB2INSTANCE=is400
listener.ora_
# listener.ora Network Configuration File:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /usr/lib/oracle/xe/app/oracle/product/10.2.0/server)
(PROGRAM = extproc)
(SID_DESC =
(SID_NAME = DB2DATABASE)
(ORACLE_HOME = /usr/lib/oracle/xe/app/oracle/product/10.2.0/server)
(PROGRAM =hsodbc)
(ENVS = LD_LIBRARY_PATH = /opt/ibm/iSeriesAccess/lib:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.18.3.32)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.18.3.31)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
DEFAULT_SERVICE_LISTENER = (XE)
tnsnames.ora_
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = srvpdf)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
DB2DATABASE =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =localhost )(PORT=1521))
(CONNECT_DATA =
(SERVICE_NAME = DB2DATABASE)
(HS=OK)
odbc.ini_
[prueba]
Description = iSeries Access ODBC Driver
Driver = iSeries Access ODBC Driver
System = xxx.xx.3.2
UserID = xxxxxx
Password = xxxxxx
Naming = 0
DefaultLibraries = QGPL
Database = CHERRYWEB
ConnectionType = 0
CommitMode = 2
ExtendedDynamic = 0
DefaultPkgLibrary = QGPL
DefaultPackage = A/DEFAULT(IBM),2,0,1,0,512
AllowDataCompression = 0
MaxFieldLength = 32
BlockFetch = 1
BlockSizeKB = 128
ExtendedColInfo = 0
LibraryView = 0
AllowUnsupportedChar = 0
ForceTranslation = 0
Trace = 0
odbcinst.ini_
[PostgreSQL]
Description = ODBC for PostgreSQL
Driver = /usr/lib/libodbcpsql.so
Setup = /usr/lib/libodbcpsqlS.so
FileUsage = 1
[iSeries Access ODBC Driver]
Description = iSeries Access for Linux ODBC Driver
Driver = /opt/ibm/iSeriesAccess/lib/libcwbodbc.so
Driver64 = /opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
Setup = /opt/ibm/iSeriesAccess/lib/libcwbodbcs.so
Setup64 = /opt/ibm/iSeriesAccess/lib64/libcwbodbcs.so
UsageCount = 1
CPTimeout =
CPReuse =
System = 172.18.3.2
User = inf5mito
Password = lonco3pue
NOTE1 = If using unixODBC 2.2.11 or later and you want the 32 and 64-bit ODBC drivers to share DSN's,
NOTE2 = the following Driver64/Setup64 keywords will provide that support.
Threading = 2
DontDLClose = 1
ODBC Driver_
-bash-3.2$ cd /opt/ibm/iSeriesAccess/lib
-bash-3.2$ ls -ltr
total 2260
-r-xr-xr-x 1 root root 443939 Apr 5 2008 libcwbxda.so
-r-xr-xr-x 1 root root 94504 Apr 5 2008 libcwbrc.so
-r-xr-xr-x 1 root root 16636 Apr 5 2008 libcwbodbcs.so
-r-xr-xr-x 1 root root 729572 Apr 5 2008 libcwbodbc.so
-r-xr-xr-x 1 root root 998060 Apr 5 2008 libcwbcore.so
and this is my error.
SQL> /
select from display@db2database*
ERROR en línea 1:
ORA-28500: la conexión de ORACLE a un sistema no Oracle ha devuelto este
mensaje:
*[Generic Connectivity Using ODBC][C077] Could not find symbol 'SQLAllocConnect'*
in dynamic library
*[C079] Failed to load dynamic library*
*'/opt/ibm/iSeriesAccess/lib/libcwbodbc.so'*
ORA-02063: 3 lines precediendo a DB2DATABASE
Edited by: user6669081 on 07-jul-2010 6:31 -
Connection to oracle database from sap R/3
Hello SAP Masters,
I do have two querries.
1) I want to download the data into oracle.
so is it possible in sap?
2)please explain me how in details?
3) I tried with DBCON .
4) But when I wrote program stating the name of the connection it is giving dump.
5) So can i get two things.
6) Some sample DBCON information.
7) And after this connection how to insert the data into oracle.ie native sql code
and abap code.
8) please can any one explain me with example in details or sample code?
Regards,
Prasad Dhaygude.Hello Ajai,
Thanks raised to infinity.
Many thanks for sharing your valuable time for my querry.
Still I do have one querry as follows:
1) Actually I want to connect with the oracle database.
so I made entries like this:
database name:deepak_data
dbs: ora
username: prasad
connection information:oracle_server=ess-serverORACLE_DBNAME=INVOICE_02
now I want to ask you.
How to write native sql code in abap.
*& Report ZP *
REPORT ZP.
TABLES: Zp,dbcon.
DATA: BEGIN OF IT_ITAB OCCURS 0,
INV_NO LIKE Zp-INV_NO,
AUBEL LIKE Zp-AUBEL,
MATNR LIKE Zp-MATNR,
FKIMG LIKE Zp-FKIMG,
END OF IT_ITAB.
data:BEGIN OF IT_ITAB1 OCCURS 0,
INV_NO like Zp-INV_NO,
end of IT_ITAB1.
DATA: exc_ref TYPE REF TO cx_sy_native_sql_error,
error_text TYPE string.
DATA: WA LIKE IT_ITAB.
START-OF-SELECTION.
SELECT * FROM Zp INTO CORRESPONDING FIELDS OF TABLE IT_ITAB.
EXEC SQL.
CONNECT TO : invoice_02 USER df_truck USING df_truck
endexec.
EXEC SQL .
LOOP AT IT_ITAB.
INSERT INTO ZINVOICE_02 VALUES IT_ITAB.
ENDLOOP.
ENDEXEC.
*ENDFORM.
I wrote the code mentioned above.
But it states that field specification missing at the time of execution.
2) Please check the code and connect to statement also.
Can you please explain me with the help of sample code that how to write
connect to statement.
3) First of all I ll have to connect to database or oracle server on which oracle
database exists.
4) And then I ll have to insert the data from zinvoice02 into oracle table invoice_02.
5)Many Many thanks for your cooperation.
6) I wish you happy Navaratri and coming Dassera.
Regards,
Prasad. -
How to connect to Oracle database from webdynprojava application
Hi
How to connect to Oracle database from webdynprojava application. where can we provide the code to connect to database.?
Thank You.Hi,
You need to create Java Bean model. The bean is a typical java bean with default constructor, getter and setter. You can have additional methods for query etc. The attributes in the class will be your model node and attributes.
However you need to configure the connection and create JNDI using visual administrator before writing the code.
You can also consider writing Session EJB with oracle and using them in WD.
http://help.sap.com/saphelp_nwce10/helpdata/en/45/dcaa4f05535591e10000000a1553f7/frameset.htm
Srini -
How to connect oracle database from tuxedo
Hi,
How to connect oracle database from tuxedo.
If any one can help me.
Regards,it depends on configuration your going to choose, there are two ways--
- Using X/Open standards, for this
you have to make an entry of Resource manager in $TUXDIR/udataobj/RM file.
Then in UBBConfig file in GROUPS section u have to set Openinfo.
It also depend on which database you are going to use.
In your service now you need to call tpopen() API from tpsvrinit() function.
- Other possibility is, take an implicit connection using Pro*C or Pro*Cobol whatever platform you are using.
EXEC SQL Connect ... -
How to connect to oracle database from visual basic 2010 express edition
I have installed visual basic 2010 express edition on windows xp. But visual basic 2010 express edition supports Microsoft sql server database file,Microsoft sql server compact 3.5, Microsoft access database file. I want to connect to oracle database from visual basic 2010 express edition. So what drivers are required and how to do connectivity?
Hello,
I wasn't clear on what you were using to make the connection. I had a look in Visual Studio 2010 (don't have express to test sorry).
I think you mean the Data Sources available under the menu Data-> Datasources. this seems to match the description you give when I
look at the list of datasource options.
In here you can make ODBC connections via the Microsoft .net Data Provider .
If you select ODBC as a datasource you can see listed the DSN's you created - for example I see 2 which use the Oracle ODBC driver.
This assumes you installed an Oracle Client + the oracle version of the ODBC driver (comes with the oracle client).
Once you created a server connection then you should see it in the server explorer.
You can also download the Oracle Developer Tools for Visual Studio which is an add on for VS.
** I suspect this is only for VS 2010 and I didn't see that Express was supported.
http://www.oracle.com/technetwork/developer-tools/visual-studio/overview/index-097110.html
Let me know if that helps.
John -
Connecting to Oracle database from ASP = please help!
i have tried every kind of combination of connection string to connect to a 9i database from ASP but it does not work!
I am using XP Professional and have 9i Developer and ODP.NET installed but I want to use OLE DB (Oracle or Microsoft) to access the database. I have a feeling the web page is not seeing the driver. here is my code:
<% Option Explicit %>
<HTML>
<HEAD><TITLE>Oracle Data Access</TITLE></HEAD>
<BODY>
<%
Dim objConnection
Dim objRecordset
Set objConnection = Server.CreateObject("ADODB.Connection")
With objConnection
.ConnectionString = "Provider=MSDAORA;Data Source=obiwan;" & _
"User ID=user; Password=pass;"
.Open
Response.Write "ADO Provider=" & .Provider & "<BR>"
Set objRecordset = .Execute("SELECT sysdate, user FROM dual")
End With
</body>
</html>Try using this connect string:
Provider=MSDAORA.1;Password=tiger;User ID=scott;Data Source=ORA92;Persist Security Info=True
substitute your username/password and Data Source here.
This works on Windows2000 with Microsoft OLEDB provider
for Oracle. -
Connect to Oracle Database from Windows Mobile
Is there any Oracle Client product that will allow Windows mobile powered devices to connect to an oracle database? I'm using .net and the compact framework 2.0.
Anyone have a clue?
Regards,
Andras EliassenI think I would call it a client tool. Maybe I wasn't so precise in my previous post, sorry. What I need is basically this:
I have a 9i database that is running on a unix box on my network. I have created a Visual Basic .Net application that is using ODT to select, insert, update and delete records in this database - and also executes some stored procedures.
Now I'm trying to move to the next step, and I want my windows mobile powered device/phone to do the same thing - Select, insert, update, delete and execute stored proc/pckgs on the database.
The only way I have found to do this, is by implementing some webservice or something in between my windows mobile device, and the database, because I cannot find dataaccess drivers/components (ODT or the like) that will work on a windows mobile powered device.
Any suggestions?
Regards,
Andras Eliassen -
Error when connecting to an Oracle Database
Hi, I'm trying to connect to an oracle database by calling a javabean from a jsp page. When I try to connect however I get this error:
java.lang.UnsatisfiedLinkError: C:\oracle\ora92\jdbc\lib\ocijdbc10.dll: The specified procedure could not be found
java.lang.ClassLoader$NativeLibrary.load(Native Method)
java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
java.lang.Runtime.loadLibrary0(Runtime.java:822)
java.lang.System.loadLibrary(System.java:992)
oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:2963)
oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:225)
oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:348)
oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:139)
oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:79)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:563)
java.sql.DriverManager.getConnection(DriverManager.java:525)
java.sql.DriverManager.getConnection(DriverManager.java:171)
I am trying to connect to the database using OCI and its tns name. Also right now I'm just using the tomcat bundled in the netbeans ide.
Anyone have any ideas on what's wrong?Why not use a type IV JDBC driver, available forfree download from Oracle? No
need for any DLL then.The standard Oracle driver comes with "oci" and
"thin" drivers.
Thin driver is 100% java.
oci driver uses the dlls.
What version of Oracle are you using? I am guessing
10?
Have you got Oracle Client installed on this machine?
(Stupid question I know)
What URL connection string are you using?
Does the "thin" driver work? ie url
"jdbc:oracle:thin:@[IP_ADDRESS]:[PORT]:[SID]"
Cheers,
evnafetsThere's another advantage of the thin driver: you don't have to have the client installed or TNS names defined for it to work.
% -
Connecting to an oracle database
Hi! I am a student of Computer Engineering. I was hoping someone could help me out giving me options of could be wrong in my database application.
The problem is this:
I connect to an oracle database and i have a username, password and an url direction. Apparently the connection is fine, because my program does not show any errors or exceptions, but when I try to retrieve data from the tables I have in my space of the database, the ResultSet object appears to be empty. And I don't have any idea what the problem is, because when I write the select statement directly in the console, the database retrieves me the information I ask, but it doesn't retrieve me anything when I do it through my program.
I will put the part of my code that is causing me trouble... I hope someone can help me:
//this is the part when I connect to the database
public void connectToDB() {
try {
// Register the ORACLE: oracle:thin driver
try {
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
catch (NoClassDefFoundError e){
System.out.println(e);
return;
System.out.println("Oracle driver succesfully loaded.");
// Connection
System.out.println("Connecting to the database... ");
conn = DriverManager.getConnection(CONEXION_URL,USUARIO,
PASSWORD);
System.out.println("Authentification process...");
System.out.println("Access granted.");
System.out.println("Connection successful.");
//conn.setAutoCommit(true);
} catch (SQLException e) {
System.out.println("Connection failed!");
System.out.println(e);
//this is the part when I make a select statement that doesn't retrieves me
//anything
public void consultaRecibosPeriodo(){
String nombre="",domicilio,fechaContrato,fechaExpedicion;
int importe;
String query = "SELECT NOMBRE FROM CLIENTE";
try{
if(conn!=null){
System.out.println("Entra a consultaRecibosPeriodo");
Statement stmt = conn.createStatement();
ResultSet resultado = stmt.executeQuery(query);
System.out.println(conn);
while(resultado.next()){
System.out.println("entra al while ");
nombre=resultado.getString("NOMBRE");
System.out.println("nombre " + nombre);
}catch(SQLException e){System.out.println("Error: " + e);}
}Hi,
Before loop on your resulset check add this test :
if(resultado.first()) {
while(resultado.next()){
System.out.println("entra al while ");
nombre=resultado.getString("NOMBRE"); // Is NOMBRE is a filed in your table ??
System.out.println("nombre " + nombre);
}skippye
Maybe you are looking for
-
Hey I'm looking for a specific voice chat application. I would like an app that would allow multiple users to join a chat room and talk via voice with each other on the iphone. I would like this app to also allow users on a PC to join into this voice
-
Can NOT rechange my Flash Drive icon?
I changed my flash disk icon last night for a try but in the second i did not. The icon comes broken. I tried to format and i download different icons on the internet. But anyway it comes broken. Can you help me?
-
J2se 1.4.2 Installation Errror 'failed to extract file'
Hi, I am running windows 2000 and am trying to install the J2SE v 1.4.2, SDK and keep on getting this error in the install shield: "Failed to extract file 'dll.ini' from binary table" I would be grateful if you could help me out why I am getting this
-
Question on top command output in solaris
Platform : Solaris 5.10 In the top output, if you look at the CPU colum, you can see that one process (2415) is consuming 95.84 % of CPU, another process (28533) is consuming 91.81%. How can this happen ? If one process is consuming 95.84 , then less
-
3.1.2 update problem and a question
For the last couple of days all my attempts in updating to 3.1.2 ended up in an error right at the conclusion of the download process. The download would get to 99% and than quit with a network time out error (even though there is actually no interne