DatabaseMetaData and ResultSetMetaData return different codes of Type SQL for number
Hello
I was testing the code of a colleague who used ResultSetMetaData who was retrieved with Statement.getMetaData () of a select statement. ResultSetMetaData.getColumnType (I) returned 2 (digital) for the SQL type number. My DatabaseMetaData used test code comes from Connection.getMetaData (). DatabaseMetaData.getColumns returned 3 (decimal) for the SQL number type.
Here is a snippet of code to illustrate the issue:
The database must contain table MY_TABLE with a column of type "digital."
String username = "user";
String password = "password";
String host = "host".
Port of String = "port";
String sid = 'sid ';
DriverManager.registerDriver (new oracle.jdbc.OracleDriver ());
Connection connection =
DriverManager.getConnection ("JDBC: thin: @" + host + ': ' + port + ': ' + sid, user, password);
Get the SQL with DatabaseMetaData type
Metadata DatabaseMetaData = connection. getMetaData();
ResultSet tables is metadata.getTables ( user, null,null, new String [] { "TABLE" });.
My_table should be the first table
if (tables. next()) {
String tableName = table.getString (3);
log.info (tableName);
ResultSet columns is metadata.getColumns ( user, tableName,null, null);.
while (columns. next()) {
String columnName = columns.getString (4);
String columnType = columns.getString (5);
System.out.println (columnName + "' + columnType" ");
Column type 3
}
columns. close();
}
tables. close();
Get the SQL with ResultSetMetaData type
Statement statement = connection. createStatement();
String SQL = ' SELECT * FROM my_table ';
. Perform statement(sql);
ResultSet resultSet = statement. getResultSet();
ResultSetMetaData metaData2 = resultSet. getMetaData();
for (int i = 1; I < = metaData2. getColumnCount(); i++) {
System.out.println (metaData2.getColumnName (I) + "' .getColumnType metaData2(i) +" ");
Column type is 2
}
Is there a reason for the discrepancy?
Kind regards
Johannes
A bug has been filed for this. You must get your license in any case. ojdbc14 is the obsolete way.
Tags: Java
Similar Questions
-
I ran a hard drive diagnostic and she returned with CODE RETURN fail 7
My computer crashed, trying everything I ran a "hard drive Diagnostics' and she came back with MAXTOR 6y160m0-fail return code 7.
Does mean my HDD id no good?
http://www.ihatedell.NET/forum/phpBB3/viewtopic.php?f=8&t=7798
According to above it is.
-
This code returns seven points of view that are not valid, and therefore not in the role that grants select access to them.
sys@database > select view_name
2 of all_views
3 where owner = "SCHEMA_OWNER."
4 and view_name not in)
5. Select TABLE_NAME
role_tab_privs 6
7 where role = "SELECT_SCHEMA_OWNER")
8.
VIEW_NAME
------------------------------
VIEW001
...
VIEW07
7 selected lines.
sys@database > user conn [schema_owner]
Enter the password:
- Connected.
schema_owner@database > select view_name
2 of all_views
3 where owner = ' SCHEMA_OWNER)'
4 and view_name not in)
5. Select TABLE_NAME
role_tab_privs 6
7 where role = "SELECT_SCHEMA_OWNER")
8.
VIEW_NAME
------------------------------
VIEW001
...
VIEW077
77 selected lines.
schema_owner@database >
If a view is invalid, you cannot grant select on it for anything.
I found my answer "Information is provided only on the roles to which the user has access" privileges granted to roles [ROLE_TAB_PRIVS] table
Once I got the role of select_schemaOwner in schemaOwner, the query returns results. It has to do with the x$ dealios in the role_tab_privs view.
-
sqlplusw and sqlplus return different characters
I wonder where the difference in character between sqlplus and sqlplusw. This is the case.
I have this insert statement. I run it once in sqlplus, once in sqlplusw:
The result is quite different:insert into drop_me (col1) values ('ç');
Version of the database is 11.2.0.2.0PROD@> select dump(col1) from drop_me; DUMP(COL1) --------------------------------------- Typ=1 Len=1: 135 => from sqlplus Typ=1 Len=1: 231 => from sqlplusw
Sqlplus version (w) is 10.1.0.4.2
(but it is reproducible with different versions)
Database Nls_characterset is WE8MSWIN1252, even as my customer NLS_LANG: AMERICAN_AMERICA. WE8MSWIN1252.Sure and characterset of a console window is not 1252, but * 850 * (Please run chcp TBC)
NLS_LANG must therefore end in. WE8PC850 or you will have problems of conversion.
Apart from this, sqlplusw is not yet supported more.-----------
Sybrand Bakker
Senior Oracle DBA -
Purchase Photoshop elements 13 Best Buy and redemption of the code does not generate serial number
So I buy Adobe Photoshop elements 13 Best Buy and follow the directions on the package to get a serial number, so I can install the application. I get an oops message that my code is not valid. Kind of strange see the package never been opened before. I guess I bought a boat at Adobe anchor. I knew that I went with the wrong product. Me once shame on you, screw me twice shame on me. It goes in the trash, and I will NEVER buy another Adobe product again. Adobe sucks!
Hi dayxmr,
no need to hate. Please, try the solutions posted by Brucgovn in this thread instead:
Re: Photoshop elements 13 - can't get a response code in the offline activation method
Kind regards
Maurice -
SQL query return different result 11 GR 1 material and GR 11, 2
Problem: SQL returns different results in 11 GR 1 material and GR 11, 2 games.
Example script:
create the table tab_main
(
SOS number (2) not null,
contract number (2) null
)
/create the table tab_sub
(
number (2) of contract non-null,.
SOS number (2) null
)
/insert into tab_main values (1, 10);
insert into tab_main values (2, 20);
insert into tab_main values (3, null);
insert into tab_main values (4, null);insert into tab_sub values (1, 10);
insert into tab_sub (20, 2) values;
commit;The SQL code:
SELECT *.
OF tab_main.
tab_sub
WHERE tab_main.sos = tab_sub.sos (+) AND
tab_main. Contract = tab_sub.contract (+) and
tab_main. Contract not in (select 1 of the double);The above query gives more results
-by 11.2.0.4
1 10 10 1
2 20 20 2-in 11.1.0.7
1 10 10 1
2 20 20 2
4
3
Please tell us what could be the reason for the behaviour of offset lines thie.
Thank youPiesset
I think it is probably a bug in 11.1.0.7 (and possibly other versions), I get the same results as your 11.2.0.4 9.2.0.7, 10.2.0.3 and 11.2.0.3, and this is the result, I expect.
Your not in the paragraph is equivalent to:
SELECT *.
OF tab_main, tab_sub
WHERE tab_main.sos = tab_sub.sos (+) AND
tab_main. Contract = tab_sub.contract (+) and
tab_main. Contract <> 1;
Since you have null values in tab_main.contract they are lost by the predicate since null = value is never true (or false).
John
-
What is the organizational structure of microsoft and what the different type of organization between microsoft and linux
Microsoft communities must answer a technical question about Windows 8, Windows 7, Windows Vista and Windows XP.
If you have a technical question, please let us know. This type of information you are requesting is not available in this forum. Do a search on the internet, and you should be able to find this kind of information.
Sincerely,
Marilyn
-
I just bought Adobe Acrobat Pro DC, and I can not find the 24-digit serial number. I can only find 2 codes to 19 different figures, but it will not accept them in the redemption of the student? Where can I find the code?
Hi dobbynation,
Please see this KB doc for help: redemption code help
Let us know if you need help.
Kind regards.
Meenakshi
-
How to add buttons in the script, and then click on run different codes?
If we run the script, then it should display ok, cancel button 6 button. If we click on button1 coding with button1 dangerousness must be running and so on.
Button1
Button2
Button3
Button4
button5
Button6
OK Cancel.
Marie rosine
// DialogSimpleButton.jsx // http://forums.adobe.com/thread/1327372?tstart=0 // how to add buttons in script, which on click run different codes? // regards pixxxelschubser function SimpleDialog() { var w = new Window('dialog', ''); this.windowRef = w; w.orientation = "column"; btn1 = w.add('button',undefined,'Button 1'); btn2 = w.add('button',undefined,'Button 2'); btn3 = w.add('button',undefined,'Button 3'); btn4 = w.add('button',undefined,'Button 4'); btnOK = w.add('button',undefined,'OK'); btnCancel = w.add('button',undefined,'Cancel'); btn1.onClick = function() {alert("Button 1");}; btn2.onClick = function() {alert("Button 2");}; btn3.onClick = function() {alert("Button 3");}; btn4.onClick = function() {alert("Button 4");}; defaultElement = btnOK; cancelElement = btnCancel; btnOK.active = true; btnOK.onClick = function() { stuff = "your stuff"; w.close(); } w.show(); } var stuff = null; SimpleDialog (); if (stuff) alert(stuff);
-
dbms_sqlhash and online md5 calculator return different results
Does anyone know how dbms_sqlhash.gethash () works?
I get the same result for string 123456.
Md5 (http://md5-hash-online.waraxe.us/) online calculator returns e10adc3949ba59abbe56e057f20f883e.
DBMS_SQLHASH. GETHASH() returns 7E8FEB2276322ECDDD4423B649DFD4D9.
--the second parameter value 2 means MD5 hash. select DBMS_SQLHASH.GETHASH('select 123456 from dual',2) from dual;
Hello
>
I get the same result for string 123456.
Md5 (http://md5-hash-online.waraxe.us/) online calculator returns e10adc3949ba59abbe56e057f20f883e.
DBMS_SQLHASH. GETHASH() returns 7E8FEB2276322ECDDD4423B649DFD4D9.--the second parameter value 2 means MD5 hash. select DBMS_SQLHASH.GETHASH('select 123456 from dual',2) from dual;
DBMS_SQLHASH. GETHASH returns the hash of the SQL statement in the first parameter Select 123456 of double, not 123456
To get the MD5 hash of the 123456 you should use DBMS_OBFUSCATION_TOOLKIT or DBMS_CRYPTO packages. The latest is preferable and more recent.
Kind regards
-
Case to interview several values and unique to different tables return value
Hi This is my first picture:
I need to query the column object from table_1 for CAR or HOME and if they are present and then returns 'Y' otherwise 'n'. Linking this table_1 to table_2 through politics and the result will be table_3with Table_1 as ( select 'CAR' Object, 2000 Policy from dual union all select 'BIKE' Object, 2000 Policy from dual union all select 'HOUSE' Object, 2000 Policy from dual union all select 'MOBILE' Object, 2000 Policy from dual union all select 'MONEY' Object, 2000 Policy from dual union all select 'CREDIT' Object, 2000 Policy from dual union all select 'SCOOTER' Object, 2001 Policy from dual union all select 'BIKE' Object, 2001 Policy from dual union all select 'BEACH' Object, 2001 Policy from dual union all select 'HOUSE' Object, 2001 Policy from dual union all select 'MONEY' Object, 2001 Policy from dual union all select 'CREDIT' Object, 2001 Policy from dual union all select 'DOOR' Object, 2002 Policy from dual union all select 'BIKE' Object, 2002 Policy from dual union all select 'GARDEN' Object, 2002 Policy from dual union all select 'MOBILE' Object, 2002 Policy from dual union all select 'MONEY' Object, 2002 Policy from dual union all select 'CREDIT' Object, 2002 Policy from dual ) select * from Table_1
with Table_2 as ( select '21' AGE, 2000 Policy from dual union all select '22' AGE, 2001 Policy from dual union all select '27' AGE, 2002 Policy from dual ) select * from Table_2
Thanks in advancewith Table_3 as ( select '21' AGE, 2000 Policy, 'Y' Many_Obj from dual union all select '22' AGE, 2001 Policy, 'Y' Many_Obj from dual union all select '27' AGE, 2002 Policy, 'N' Many_Obj from dual ) select * from Table_3
Banner:
Oracle Database 11 g Release 11.2.0.2.0 - 64 bit Production
PL/SQL Release 11.2.0.2.0 - Production
"CORE 11.2.0.2.0 Production."
AMT for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
!Thanks for the insert statements.
Here's a waywith Table_1 as ( select 'CAR' Object, 2000 Policy from dual union all select 'BIKE' Object, 2000 Policy from dual union all select 'HOUSE' Object, 2000 Policy from dual union all select 'MOBILE' Object, 2000 Policy from dual union all select 'MONEY' Object, 2000 Policy from dual union all select 'CREDIT' Object, 2000 Policy from dual union all select 'SCOOTER' Object, 2001 Policy from dual union all select 'BIKE' Object, 2001 Policy from dual union all select 'BEACH' Object, 2001 Policy from dual union all select 'HOUSE' Object, 2001 Policy from dual union all select 'MONEY' Object, 2001 Policy from dual union all select 'CREDIT' Object, 2001 Policy from dual union all select 'DOOR' Object, 2002 Policy from dual union all select 'BIKE' Object, 2002 Policy from dual union all select 'GARDEN' Object, 2002 Policy from dual union all select 'MOBILE' Object, 2002 Policy from dual union all select 'MONEY' Object, 2002 Policy from dual union all select 'CREDIT' Object, 2002 Policy from dual ), Table_2 as ( select '21' AGE, 2000 Policy from dual union all select '22' AGE, 2001 Policy from dual union all select '27' AGE, 2002 Policy from dual ) SELECT age, policy, Many_Obj from ( SELECT t2.age, t2.policy, CASE WHEN SUM( CASE WHEN t1.object IN ('CAR','HOUSE') THEN 1 ELSE 0 END) over( PARTITION BY t2.age,t2.policy) > 0 THEN 'Y' ELSE 'N' END Many_Obj, row_number() over (PARTITION BY t2.age,t2.policy order by 1) rn FROM Table_1 t1, Table_2 t2 WHERE t1.policy = t2.policy ) where rn = 1; AGE POLICY MANY_OBJ --- ---------------------- -------- 21 2000 Y 22 2001 Y 27 2002 N
I advise you to spend the time learning analytical questions and using CASE expressions.
-
I just picked up a 12 inch I have pad PRO and bought a keyboard provided by Apple, however I find that the base remains unstable and keeps the hustle when you type, the seller it says it's a design flaw. Can someone tell me if this is the case?
find it hard to imagine that Apple could sell these defective products.
If the seller is an authorized Apple reseller, an independent company,
You may need to ask you if you could see & try a different product sample
because you might be looking at something that has a defect.
{According to the related help page, Type position should be more
stable to use. However if the keyboard is not flat, this sounds like default.}
Sounds as if you're not at the official Apple Store (apple retailer)
but, on the contrary, are somewhere else. Could you give more information?
Some keyboard accessories are made by third party companies; so
If the product has an Apple product model number, we note here.
When considering the purchase of an accessory, it's a good idea to test
and check in the store before you buy. An official Apple Store has
a different return policy as an independent reseller of Apple.
Don't know if I can be useful; These chat rooms are usually Apple
users of products such as yourself, who have taken their unpaid time
to see if they can help the other users of the product.
Good luck...!
-
OBIEE logical column has same SQL but returns different results
I have a SQL query with a case statement that returns the correct results by operating in Oracle SQL Developer. I've created several logical columns in OBIEE, one for each case in the original query. However, the results returned by each logical column OBIEE are radically different from the original SQL query results, even if the SQL code is virtually identical.
For example, a column logical OBIEE that returns incorrect results contains the following SQL code:
SUM (CASE when
("Registration - College". "" Effective colleges F. ("" Postal code "like '% a %') or
("Registration - College". "" Effective colleges F. ("" Postal code "like '%B %') or
("Registration - College". "" Effective colleges F. ("" Postal code "like '%c %') or
("Registration - College". "" Effective colleges F. ("" Postal code "like"% %") or
("Registration - College". "" Effective colleges F. ("" Postal code "like '%G %') or
("Registration - College". "" Effective colleges F. ("" Postal code "like"hour %") or
("Registration - College". "" Effective colleges F. ("" Postal code "like"%%J") or
("Registration - College". "" Effective colleges F. ("' Postal code ' like '%R %') or
("Registration - College". "" Effective colleges F. ("" Postal code "like '%s %') or
("Registration - College". "" Effective colleges F. ("" Postal code "like '%T %') or
("Registration - College". "" Effective colleges F. ("" Postal code "like"% %") or
("Registration - College". "" Effective colleges F. ("" Postal code "like '%x %') or
("Registration - College". "" Effective colleges F. ("' Postal code ' like '%Y %')
THEN 0 OTHERWISE 1 END)
The case statement in the original SQL query, which returns the correct results, is as follows:
CASE
WHEN (postal_zip_code_permanent like "%%K") or (postal_zip_code_permanent like '% %') or (postal_zip_code_permanent like '%m %') or (postal_zip_code_permanent like '%n %') or (postal_zip_code_permanent like "%p %") THEN "Ontario".
WHEN (postal_zip_code_permanent like '% a %') or (postal_zip_code_permanent like '%B %') or (postal_zip_code_permanent like '%c %') or (postal_zip_code_permanent like '% %') or (postal_zip_code_permanent like '%G %') or (postal_zip_code_permanent like "%hour") or (postal_zip_code_permanent like "%%J") or (postal_zip_code_permanent like "%%R") or (postal_zip_code_permanent like '%s %') or (postal_zip_code_permanent like '%t %') or (postal_zip_code_permanent like '% %') or (postal_zip_ code_permanent like '%x %') or (postal_zip_code_permanent like "%%Y") THEN "Canada, other than Ontario.
WHEN (substr(postal_zip_code_permanent,1,1) IN ('1 ', '2', '3', '4', '5', '6' ', 7',' 8 ', ' 9',' 0') or (postal_zip_code_permanent like '%d %') or (postal_zip_code_permanent like '%f %') or (postal_zip_code_permanent like ' % I %') or (postal_zip_code_permanent like "% O") or (postal_zip_code_permanent like "%%Q") or (postal_zip_code_permanent like "%%U") or (postal_zip_code_permanent like ' % W ') or (postal_zip_code_permanent like "%%Z")) THEN 'other')
WHEN (postal_zip_code_permanent like '% + %') or (postal_zip_code_permanent like '%. %') or (postal_zip_code_permanent like ' %? %') or (postal_zip_code_permanent like '% %') or postal_zip_code_permanent IN ('+ ','.', '?)) (',',') And THEN "Invalid."
WHEN postal_zip_code_permanent is null THEN 'Blank '.
Of OTHER postal_zip_code_permanent
END
Now I see what the problem was. In the original SQL query, each condition is exclusive, for each record will only be categorized in one of the scenarios WHEN. But in OBIEE, each logical column is autonomous, so some records were classified into more than logical column, even if each logical column was supposed to be exclusive.
-
Different codes for different - looking of table (but the same memory-wise)
(I've posted something similar here as well, but it's kind of emergency):
http://www.Java-forums.org/advanced-Java/40756-HashMap-treating-isomorphic-but-different-objects-same-key.html)
Hi all
I am trying to program the Reversi game on my computer and I represent the game like a lookup table tree using a hash table.
Any available to the Commission is represented as an int. [8] [8]. The hash table takes a configuration of the Board of Directors as a key, and is meant to restore an object that contains information about the possible move.
But I have a problem. Suppose I have a Council (4 x 4 for readability):
Code:
Board of Directors of int [] [] = {{0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}};
And suppose that it gives a hash code of say "1607178090".
Then, when I change the Council;
Board = {{0,0,0,0}, {0,0,0,0}, {1,1,1,1}, {1,1,1,1}};
I want the hash to be different code, then my hashMap will recognize it as a different Board.
---
I tried to make a Matrix object and dominant equals and hashCode, but I'm not sure what to change. The Java API says that the hash code for the tables is based on the content, even if the following code renders the same code to hash twice. I don't really understand this:
int [] a1 = {0,1,2};
System.out.println (a1.getHash ());
A1 [0] = 1;
System.out.println (a1.getHash ());
Moreover, my Matrix class is:
to import java.util.Arrays;
public class {Matrix
public int [] [] Council;
public matrix()) {}
}
{public matrix (int [] [] b)
Board = b;
}
@Override
public int hashCode() {}
first final int = 31;
int result = 1;
System.out.println ("based hash code calculation on :"); ")
first = result * result + Arrays.hashCode (board);
for (int c = 0; c < board.length; c ++) {}
for (int r = 0; r < board.length; r ++) {}
System.out.Print(""+Board[c][r]+"");
}
System.out.println ();
}
System.out.println ("return" + result);
return the result;
}
@Override
public boolean equals (Object obj) {}
If (this is obj)
Returns true;
If (obj is nothing)
Returns false;
If (getClass()! = obj.getClass ())
Returns false;
Matrix other obj = (matrix);
If (!.) Arrays.Equals (Council, other.board))
Returns false;
Returns true;
}
}
Published by: 845707 on 19 / mrt / 2011 02:20845707 wrote:
I don't really understand this:
int [] a1 = {0,1,2};
System.out.println (a1.getHash ());
A1 [0] = 1;
System.out.println (a1.getHash ());Me neither does table have a method called "getHash();" these days?
In case you meant hashCode(), what you call it is hashCode() of the object, which would remain the same for the object during its lifetime.In your example code you use correctly Arrays.hashCode (), then why did you write an example that does not represent your actual code?
-
Can I access a label inside a MC and then return to the main time line
Here is my current set up.
I have a section marked on the main timeline that has the icons of 12 different videos. Each icon acts as a button and brings a user to a section marked with a FLV Playback component work video to play the corresponding video. These marked sections are located on the main of the time.
This methog is my very long time mainline. Is there a way to do an additional MC which will hold all the buttons of the video and then have this MC separated in marked sections.
In other words can I access a label inside a MC and then return to the main time line?
My current code to access the label placed on the main timeline is:
HowTo_maininfo_mc.theArrangement_btn.addEventListener (MouseEvent.CLICK, theArrangement_btn_amimated_btnDown);
function theArrangement_btn_amimated_btnDown(event:MouseEvent):void {}
gotoAndPlay ("theArrangement");
}
What it would be like if my "theArrangement" label would be located inside a MC?
Is there a specific code of if I want to have a close button located on the label inside a MC and he needs to get on a label located on the main timeline?
You should have an image with an flvplayback component and having each button assign the variable value from a source that is used by your component:
var sourceVar:String;
function theArrangement_btn_amimated_btnDown(event:MouseEvent):void {}
sourceVar = "arrangement.flv"; for example
gotoAndPlay ("flv_pb");
}
///
and as part of the "flv_pb", use:
yourflv_pb.source = sourceVar; where yourflv_pb is your component instance name.
Maybe you are looking for
-
I had to restart firefox due to ben salah toolobar. Reinstalled downloader helper but can't find where to download converterhelper without paying again for her. I got my registration code. I have windows 7 Home Edition. Any help would be appreciated.
-
Toshiba bluetooth does not work - leave peripheral to connect is grayed out
Hello I joined toshiba bluetooth "Qualcomm-Atheros bluetooth 4.0 AR3012"When I turn on the bluetooth Allow a device to connect is grayed on I can't click on itAlthough I check the box to make it discoverable to other bluetooth devices But I can't fin
-
Yosemite 006-2015 a security update is not installed
Yosemite 006-2015 a security update does not install. I get a message saying that the update could not be verified and tells me to re-download and try again. Tried several times. It does not work. What is the trick to install?I even want to since it
-
How do I exit fullscreen & back to my normal screen setup?
I've been on the internet trying to enlarge the content on my screen, so I wouldn't have to scroll left to right to read the information. I went into the display & clicked full screen & all my options have disappeared. for example: bars of tasks at t
-
How to apply the theme of Oracle Alta UI in ADF
Hi allI use Jdeveloper 11.1.1.1.7.2 release1.Can anyone provide your inputs on how to apply the theme of Oracle Alta UI in the ADF.For any consultation on Alta IU @ http://www.oracle.com/webfolder/ux/middleware/alta/start-develop.html Thank you and b